[nSLUG] Virtualbox problem (was Re: Debian vserver kernel)
jwark at eastlink.ca
Sat Nov 8 15:35:01 AST 2008
sudo mount -t vboxsf share mountpoint
that you use to mount your shared folder is essentially doing a
"one-shot" change of user to the root user for the purposes of issuing
the mount command. See man sudo.
I dislike the sudo command and much prefer to use su (see man su) if I
have to make use of root permissions to do something.
But in addition to getting experience with virtualbox, this little
exercise also had the objective of setting up a general purpose system
for executing 32-bit only applications on my AMD64 laptop. The intent is
to launch the vm when the laptop boots so that it would be there already
completely available whenever a user wanted it. For that, the shared
folder has to be mounted automatically when the vm boots.
There is something basically wrong with virtualbox if the mount cannot
be issued during bootup.
Eugene Cormier wrote:
> Wow...I've never had to dig that deep to get shared folders to work....I
> simply followed the directions located here:
> so I made the folder to share on my host machine
> mkdir ~/VirtualBoxShare
> added it to vbox
> VBoxManage sharedfolder add "virtualmachinename" -name "guestsharename"
> -hostpath /home/VirtualBoxShare/
> then in the linux guest (with vbox additions)
> sudo mount -t vboxsf share mountpoint
> and that just worked for me......but I assume (maybe incorrectly) any
> mount/umount command must be run as root for any filesystem under
> debian/ubuntu right?!? .....unless of course you change permissions on
> also check out the help file included with Virtualbox....it goes through
> the shared folder setup in depth
> hope this helps
> ps....found this on virtualbox' website
> On Fri, 2008-11-07 at 16:02 -0400, Jack Warkentin wrote:
>> Hi everybody
>> I switched almost completely to GNU/Linux from Windows 98 five or so
>> years ago. My only remaining need for Windows is for doing my income
>> tax. (I refuse to use a web-based application where the data is stored
>> on somebody else's machine.)
>> I have been using a virtualization product called Win4Lin home with
>> Windows 98, which uses a patched kernel and is no longer supported. I
>> have an unactivated copy of Win XP SP2 which I would like to set up in a
>> virtual machine. After reading about KVM, Xen, Qemu and Virtualbox I
>> decided to try out Virtualbox.
>> But first, as an experiment, and to gain some experience, I decided to
>> set up a 32-bit Debian testing system in a Virtualbox vm on my
>> AMD64-based laptop, where I ran into some difficulties.
>> Setting up the vm from the GUI interface and installing 32-bit Debian
>> testing went smoothly. I also succeeded (eventually, had to find an
>> appropriate kernel and compile environment) in installing the Guest
>> Additions and managed to enable sharing of my full file system by including
>> <SharedFolder name="FullHost" hostPath="/" writable="false"/>
>> in the vm's definition file, and
>> FullHost /FullHost vboxsf noauto,users,ro,uid=1004,gid=1004 0 0
>> in its /etc/fstab file.
>> The root of my problem is that /sbin/mount.vboxsf (the
>> Virtualbox-provided binary that gets invoked by the mount command) will
>> not allow ordinary users to mount FullHost, no matter what options (most
>> of which are not allowed) I try putting into the fstab file.
>> Removing the "users," from fstab allows root to perform the mount
>> successfully from the command line.
>> But I didn't want to have to su to root in order to perform this mount
>> every time. So I removed the "noauto," from fstab and tried again. Here
>> is the result from the /var/log/boot file (with the date/timestamps and
>> several irrelevant lines removed):
>> Mounting local filesystems.../sbin/mount.vboxsf: mounting failed with
>> the error: No such device
>> Activating swapfile swap...done.
>> INIT: Entering runlevel: 2
>> Starting VirtualBox Additions ...done.
>> Starting VirtualBox host to guest time synchronisation ...done.
>> Starting VirtualBox Additions shared folder support/sbin/mount.vboxsf:
>> mounting failed with the error: Protocol error
>> The first failure is understandable - the virtualbox daemons had not yet
>> been started. But the second is not understandable. In the first place,
>> why would there be a second attempt at the mount? In the second place,
>> why would it fail, when root is able to perform the mount successfully
>> from the command Line?
>> So I finally tried putting the mount command into /etc/rc.local as follows.
>> . /lib/lsb/init-functions
>> log_action_msg "In rc.local, about to execute \"mount -a\""
>> mount -a
>> log_action_msg "$? returned from \"mount -a\" in rc.local"
>> (The first line is to make the log_action_msg function available.)
>> The results were disappointing. Again from /var/log/boot
>> In rc.local, about to execute "mount -a".
>> /sbin/mount.vboxsf: mounting failed with the error: Protocol error
>> Note that not only did the mount fail, but that the mount command never
>> returned to the rc.local script for execution of the last log message
>> I suppose I should address the first problem (mount failure) to the
>> virtualbox team and the second (return failure) to the Debian people,
>> but since Eugene seems to have had a lot of experience with virtualbox I
>> thought maybe he might be able to shed some light on this.
>> Any help, from anybody, would be much appreciated.
>> Eugene Cormier wrote:
>>> On Fri, 2008-11-07 at 09:11 -0400, D G Teed wrote:
>>>> I see a lot of the chatter around vserver is from 2005ish, and not
>>>> recent. Is there something more commonly used now? Xen?
>>>> Virtualbox? OpenVZ? VMware? Or should I look at compiling
>>>> my own kernel for vserver?
>>> Donald, depending on what you're doing (and I assume you're probably
>>> doing some kind of linux server as opposed to running windows) then I
>>> would say the way to go is to use Xen or KVM ......personally though I
>>> like to toy with different OS' so I started using Virtualbox (which I
>>> love) and I've recently setup a http server on it....it's been rock
>>> solid (no crashes or other problems) for about 2 years now
Jack Warkentin, phone 902-404-0457, email jwark at eastlink.ca
39 Inverness Avenue, Halifax, Nova Scotia, Canada, B3P 1X6
More information about the nSLUG