LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 05-17-2010, 11:16 AM   #1
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Rep: Reputation: 86
Unhappy Qemu-kvm file sharing Linux host Xp guest problems


Hi.

I use a Slack64 13.0 as host and Xp "pro" as guest.

I tried many ways to share /media folder, in order to get instant access to usb keys, but i always failed.

1- Using the -smb switch, my 2 Xp crashes randomly.

2- Using a real samba share, users can't write in /media/usbkey because it's rw-r-r (don't want Xp users to enter any login/password). By the way i found impossible to change to rw-rw-rw /media/* . If someone knows how i can achieve this i'll be happy.

3- Using a ftp, firefox can read the share, but filezilla nor ftp included in Xp can list the files :/ weird.

4- Don't want to use nfs, because one of my Xp is fat32 formated.

5- Don't want to use the direct usb connect from qemu, because it must be simple for users.

I spent days before realizing my only hope is to post my question here.
 
Old 05-18-2010, 02:12 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,533
Blog Entries: 12

Rep: Reputation: 171Reputation: 171
Quote:
Using a real samba share, users can't write in /media/usbkey because it's rw-r-r (don't want Xp users to enter any login/password). By the way i found impossible to change to rw-rw-rw /media/* . If someone knows how i can achieve this i'll be happy.
Something with "force create mode" or "force directory mode" perhaps? See the following:

http://www.linuxquestions.org/questi...-saved-800859/
 
Old 05-18-2010, 04:00 PM   #3
gezley
Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware64, NetBSD
Posts: 499

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by Linux.tar.gz View Post
Hi.

I use a Slack64 13.0 as host and Xp "pro" as guest.

I tried many ways to share /media folder, in order to get instant access to usb keys, but i always failed.

1- Using the -smb switch, my 2 Xp crashes randomly.

2- Using a real samba share, users can't write in /media/usbkey because it's rw-r-r (don't want Xp users to enter any login/password). By the way i found impossible to change to rw-rw-rw /media/* . If someone knows how i can achieve this i'll be happy.

3- Using a ftp, firefox can read the share, but filezilla nor ftp included in Xp can list the files :/ weird.

4- Don't want to use nfs, because one of my Xp is fat32 formated.

5- Don't want to use the direct usb connect from qemu, because it must be simple for users.
Do the Windows users have accounts on the Slackware system? As far as I know users must be members of the plugdev group in order to access removable media. Usually you assign a user to this group when running the adduser script. I imagine that unless the Windows guests have an account on the Slackware server, and unless they are members of the plugdev group, they won't be able to access the USB memory stick, no matter what permissions you grant guest users in smb.conf. The underlying Linux permissions need to be fixed first, and to my mind that means any user wanting to access removable media needs to be a member of the plugdev group, which means he also needs to be a user on the Slackware server. Unfortunately for you it probably also means your Windows users will need to authenticate to the Samba server with a username and password. I could be completely wrong of course but this seems to me the problem.

I presume you also have writeable = yes under your [media] section in your smb.conf?

Don't forget as well that directories need the executable bit set - your rw-rw-rw- would not allow users to drill down through folders on the removable media. It would need to be rwxrwxrwx I think.
 
Old 05-18-2010, 04:12 PM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.15.5
Posts: 1,533
Blog Entries: 12

Rep: Reputation: 171Reputation: 171
Well, the XP users have to enter a password to logon to XP, so that can almost certainly be automatically passed to the samba network share for authentication without need for additional typing. If so, there shouldn't be a problem adding them as users to the Slackware system as members of plugdev..
 
Old 05-20-2010, 08:19 AM   #5
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Original Poster
Rep: Reputation: 86
This doesn't work :
force create mode = 0660
force directory mode = 0770

neither
writeable = yes

There's no authentication in XP

I can't change permission for /media/KINGSTON its drwxr-xr-x
I made a thread about this specific problem :
http://www.linuxquestions.org/questi...5/#post3971465
 
Old 11-18-2010, 09:33 AM   #6
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Original Poster
Rep: Reputation: 86
Yay !

Created /etc/udev.d/11-media-by-label-auto-mount.rules

Here's the content :

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime,users"
# Filesystem specific options
ACTION=="add", PROGRAM=="/sbin/vol_id -t %N", RESULT=="vfat|ntfs-3g", ENV{mount_options}="$env{mount_options},utf8,gid=100"
ACTION=="add", PROGRAM=="/sbin/vol_id --label %N", ENV{dir_name}="%c"
ACTION=="add", PROGRAM!="/sbin/vol_id --label %N", ENV{dir_name}="usb-%k"
#ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options},umask=000,users /dev/%k /media/%E{dir_name}"
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o rw,noauto,users,umask=000,iocharset=utf8 /dev/%k /media/%E{dir_name}"
ACTION=="remove", ENV{dir_name}=="?*", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
LABEL="media_by_label_auto_mount_end"

--------------EDIT :
Seems umounting doesn't work properly.
I'm playing around with two systems and i'm a bit confused by now. Anyway this is a huge step.

Last edited by Linux.tar.gz; 11-18-2010 at 11:16 AM.
 
Old 11-23-2010, 05:57 AM   #7
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Original Poster
Rep: Reputation: 86
Installed pmount, and changed /etc/udev.d/11-media-by-label-auto-mount.rules for using pumount instead of umount.

Now it works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM / QEMU and NAT on the host machine (mini-tutorial) heby Linux - Networking 5 05-16-2012 10:17 AM
Has anyone attempted running OS/2 guest under KVM (or other host)? kaza Linux - Virtualization and Cloud 3 05-16-2010 02:53 PM
[SOLVED] Qemu kvm : No eth0 inside a Slackware-13.0 guest, although listed in lspci and lsmod Linux.tar.gz Slackware 9 02-08-2010 06:36 PM
Solaris 10 guest endless reboot under KVM/Qemu green_dood Linux - Software 6 12-13-2009 01:20 AM


All times are GMT -5. The time now is 12:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration