Tips on running Sun Virtualbox

November 20, 2007 at 10:00 pm 46 comments

The following are tidbits I have learn while running Virtualbox on various systems.

Host Related Issues

Running Virtualbox on an Ubuntu Host

There are two issues:

  1. When you click attempt to open the settings on a virtual machine, you get the following error:

    Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.

    The cause of this problem is that usbfs is not turned on in Ubuntu. To fix this, you need to edit the file /etc/init.d/ (remember to use sudo). Search and uncomment out all of the code lines:

    # Magic to make /proc/bus/usb work
    #mkdir -p /dev/bus/usb/.usbfs
    #domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
    #ln -s .usbfs/devices /dev/bus/usb/devices
    #mount --rbind /dev/bus/usb /proc/bus/usb
  2. Unfortunately, this does not solve the problem entirely. When I attempt to access the USB from the guest, I get the following error message.

    Failed to attach the USB device

    Even though you enabled usbfs, the user do not have permission to use USB. You can set up a rule to give each user access. Because everyone who use Virtualbox has to be in the group vboxusers. The easiest way to give every Virtualbox user access would be to give vboxusers access. Sudo edit the file /etc/udev/rules.d/40-permissions.rules, locate the following line:

    # USB devices (usbfs replacement)
    SUBSYSTEM=="usb_device", MODE="0664"

    Change the line to:

    # USB devices (usbfs replacement)
    SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664"

Running Virtualbox on a Mandriva Host

When you install Virtualbox on Mandriva (I am using Virtualbox 1.6.2 on Mandriva 2008.1), it throws an exception when I run the VM:

Virtualbox kernel driver not installed.

This error is encountered if I install the Virtualbox OSE from the Mandriva repository or the Virtualbox rpm from (note: the version I am using is for Mandriva 2008.0, a 2008.1 was not available). The problem is that Mandriva needs a kernel package to compile the Virtualbox kernel driver. First, you need to determine what kernel module you are using. On a desktop, you are likely to be using kernel-desktop-devel-latest and on a laptop you are likely to be using kernel-laptop-devel-latest. When you boot up your machine, you can see which one you have in the boot menu. You should install Virtualbox in the following order.

  1. Install the kernel-desktop-devel-latest or kernel-laptop-devel-latest (depending on whether you have a laptop or desktop). This must be install first because Virtualbox need it to compile a new kernel module.
  2. Download and install the Mandriva Virtualbox rpm from
  3. Add the users that will use Virtualbox to the group vboxusers.

Guest Related Issues

Installing guest additions on CentOS / RedHat

The following have been tested on CentOS 5.2 and 5.4, which is a clone of RedHat enterprise Linux 5.2. You’ll need to install the gcc and kernel source by running the following command as root:

yum install gcc -y
yum install kernel-devel -y

When you run the Linux addition, you’ll get an error indicating that the Linux module cannot be built. Before you compile, you need to set the KERN_DIR variable. To figure out where the directory is, go to /usr/src/kernels. Inside should be the kernel version directories.
type the following command:

uname -rp

The command will return the kernel version and the type of processor. For example, mines return the following:

2.6.18-164.e15 i686

In the /usr/src/kernels is the directory 2.6.18-164.11.1.el5-i686, so we will set the directory using the command:

export KERN_DIR=/usr/src/kernels/2.6.18-164.11.1.el5-i686

Now you can run the Linux Additions.
After the installation, you may notice that the OS was unable to detect the correct resolution, so you have to manually add the the appropriate modes line to your display section. The following is an example from my laptop:

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	DefaultDepth     24
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes   "1280x800"

Note that seamless and automatic guest display will not work because it requires xorg server 1.3 or later. CentOS / RHEL 5.2 only has version 1.1.

Installing guest Additions on Linux Mint

Install build-essentials. This will install the kernel header, source, and compiler so you can run the guest additions.

Installing guest Additions on Suse 10.3

When you try to run the guest addition, you’ll get an error message that you have to install header, source, and gnu c. You need to use YAST to do the following

  1. Use YAST and add OSS source to the repository list.
  2. Install the packages gcc, kernel-source, linux-kernel-headers.

After the header, source and compiler is installed, the guest additions seems to work only some of the time. Suse runs the init scripts in parallel and sometimes the vboxadd script end up running after the Xorg.

There are two way to fix this:

  1. Set RUN_PARALLEL=no in /etc/sysconfig/boot. This may cause a slight delay in runtime.
  2. You can add a dependency to /etc/init.d/.depend.start so that vboxadd is executed after xorg. To do this, find the line for xdm: and add vboxadd to the end of the line. If you reinstall the guest addition, you may have to do this again.

Shared Folder on a Linux Guest

Virtualbox allow you to pass data between host and guest through a shared folder. The instructions in the manual is not necessary very clear. The manual states that you are suppose to run the following command in a Linux host to mount the shared folder:

mount -t vboxsf [-o OPTIONS] sharename mountpoint

The trouble is that users may not understand what the sharename and mountpoint is and that shared folder under Linux is quirky and weird.

Here’s how it works, in the settings for each machine, you can add a shared folder. The process is fairly intuitive, you click on the add button and select a directory where the share directory will be a sharename is automatically created. This is the share name you will use in the mount command. The mount point is simply a directory that you will mount the share folder to. You will have to do this as root or use sudo. For example:

mount -t vboxsf vshare /home/paulsiu/vshare

The problem is when you tried this, you get the following error:

/sbin/mount.vboxsf: mounting failed with the error: Protocol error

If you look at syslog, you’ll see the following error:

Nov 8 19:28:09 wxbuilder kernel: vboxvfs: sf_glob_alloc: vboxCallMapFolder failed rc=-102
Nov 8 19:28:09 wxbuilder kernel: sf_read_super_aux err=-71

Apparently, you’ll only get this error if you use the default sharename. When you create a new shared folder, Virtualbox will ask where your shared directory is on the host. When you select the shared directory, the sharename will default to that directory. If I create a shared folder at “/home/paulsiu/vshare”, virtualbox will generate a sharename of “vshare”. Unfortunately, if you use this default sharename, you will get a protocol error, so you should rename the sharename to something other than default, such as “vboxshare” for example. I have no idea why, but that appears to be what’s happening.

With the new shared name, you can now mount the shared directory. Unfortunately, the directory is mounted as root with the group of root and read writable only by root. Since it is a bad idea to login as root, your shared directory is readonly.

The user manual suggests using the mount options and set the uid, gid, and mode. But the manual lies, you cannot set the mode. The permission on the shared directory is locked to writable by user only. This mean you cannot create a single persistent directory for all users on the system.

One way around this is to create a vshare directory in each of the user’s home directory and have the login script mount the shared directory to this home directory as the user.

mount -t vboxsf -o uid=<user> <sharename> /home/<user>/vshare

Seamless Mode or Auto-resize Guest Display is grey out on a Linux Guest

According to the user manual, you must have Xorg Server 1.3 or later. To check what version you have type the following command at the command line:

X -version

If the Xorg X server is lower than 1.3, Seamless and Auto-resizing will probably be disabled. Ironically, enterprise Linux like RedHat, CentOS, and SLED are likely to be using an older Xorg Server, so corporate users will most likely to be hit by this limitation.

Windows guest startup with a inaccessible boot device message

When I boot up windows 2000, I got the message “INACCESSIBLE_BOOT_DEVICE”. The problem was traced to the IDE controller type. I had set the IDE controller to PIIX4 when it was previously set to PIIX3. Setting it back to PIIX3 corrected the problem.

64-bit Guest Issue

You can only install 64-bit OS on a 64-bit host. In addition, you will need hardware virtualization support like Intel VT-x or AMD-V for your cpu. In the case of Intel, be real careful of what cpu you buy because Intel has multiple virtualization technologies. The Intel P7350 (used in popular machines like HP-DV5) is listed on the Intel web site of supporting hardware virtualization, but it appears that it has VT-d and not VT-x. Virtualbox needs Intel VT-x, so if you have a Intel processor and don’t have VT-x, you cannot use a 64-bit guest.

Setup Issues

Upgrading Virtualbox

On the Linux box, you generally uninstall the old version and install the new version. On windows, running the installer generally upgrade the old version. There are things to watch out for such as snapshot incompatibility. Follow the following instructions for best results.

  1. Close down all of the virtual machines.
  2. Go through each of the virtual machine and make sure that you get rid of snapshots. The reason is that snapshots are not necessary compatible from version to version. If you don’t do this, you may find that you cannot start your machine any more. To recover, you will have to reinstall the old version and then get rid of the snapshots.
  3. Virtualbox stores the the settings and virtual machine files in .VirtualBox in the user’s home directory on Linux. I am not sure where it is stored in windows. In any case, backup this directory in case somethings goes terribly wrong.
  4. Uninstall Virtualbox. If you are using Windows Host or a Linux with package management, all you need to do is to run the uninstall. If you installed Virtualbox from source, I have no idea how you would uninstall (the manual doesn’t list a way to do it). I assume you just halt Virtualbox and then install over the previous version.
  5. Install the new version of Virtualbox. With luck, all of your virtual machine should come up. When upgrading, I got the following error message:

    RTR3Init failed with rc=-1912 (rc=-1912)

    The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

    '/etc/init.d/vboxdrv setup'

    may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

    To fix this, do exactly as the mesage tell you to do:

    sudo /etc/init.d/vboxdrv setup

    Note that this only works if you have the compiler installed.

  6. You may find that your guest additions no longer work and will have reinstall the guest additions.

Virtual Disk setup

You can create virtual disk, but one problem is that they will run out of space and there is no easy way to extend them. The following are my recommendations:

  • Create a really large dynamic virtual disk (ex: 200 Gb), and then create a much smaller partition on it (ex: 5 Gb). Because the disk is dynamic, the actual VDI file is small initially no matter how “large” the drive is. Now, we create a small actual partition on it because we want to limit the actual size of the file. For example, if we run a disk defrag utility, it may cause the drive to take its full size. By keeping the actual partition small, you can avoid the disk from growing to the maximum size of the disk. When we start nearing the end of the partition, we can extend it by using an utility like gparted. By doing this, you can have tons of VDI file all at 200 GB, but actually taking up a fraction of actual disk space.
  • On a Linux guest, do not use UUID references in your /etc/fstab. A lot of distro these days try to be helpful and use UUID references. By using UUID reference, you can move the drive from hda to hdb and it would still reference the partition. While this is very helpful with hardware, this is not so useful on a VM since there’s really no disk to swap around. In addition, when you clone a drive, it will generate a new UUID. If you attempt to swap the new cloned drive with the old one and you use UUID, the OS will not be able to find the drive and crash.
  • Keep it simple by using one partition per virtual disk. With the new SATA configuration, you can have as many drives as you like,
  • For a lot of Linux virtual machines, I generally use a 3 disk configuration: root, home, and swap. This way, I will be able to reinstall without wiping out home. If home or root runs out of space, I can swap in a larger disk.

Bugs and workarounds

Disk Cloning corruption in Virtualbox 2.10

In release 2.1, the command to clone virtual disk change from clonevdi to clonehd. Normally, you can clone a virtual disk by running the command:

vboxmanage clonehd olddisk newdisk

However, this did not work in version 2.10 for some reason. The disk image is corrupted. To get around this problem do the following instead:

  1. Use your host’s copy command to make a copy of the virtual disk.
  2. The copy of the virtual disk has the same UUID as the old disk, so you will need to reassign a new UUID by using the following command:
    VBoxManage internalcommands sethduuid <newVirtualDiskFile>


Keyboard corrupted by Linux Guest Addition in Virtualbox 2.1.0

Recently, I installed Linux Mint as a guest on Virtualbox 2.1.0. Whenever I type a space, Gnome Do would pop up. This happens when I type a space in any field. Normally, Gnome Do is triggered by <super>space, where <super> is the windows key. Virtualbox 2.1.0 addition apparently corrupted the keyboard so that the <super> key doesn’t exists any more. So far, it may only affect US keyboards. See

One work around is to install an earlier virtualbox 2.0.6 guest addition, which works with 2.1.0 and do not have this problem. The guest addition can be download here and you can mount it as a CD.


Entry filed under: CentOS, linux, mandriva, Redhat, suse, ubuntu, Virtualbox, Virtualization.

Why can’t I suspend to RAM or suspend to disk without Proprietary driver Video screen shrinks if you logout after sleep or hibernate in Linux

46 Comments Add your own

  • 1. bneradt  |  December 8, 2007 at 2:03 am

    Thanks for the help!

  • 3. Roger Gallion  |  December 26, 2007 at 9:32 am

    Great tip on the shared folder problem. Renaming the shared folder worked for me using a WinXP host with Ubuntu 7.10 guest.

  • 4. Jim  |  December 27, 2007 at 12:40 pm

    Fantastic…the share folder fix worked for me with Windows XP as my host OS and Ubuntu 7.10 as my guest. This was a life saver as I’m using both of these OSes to do things at work every day. Thanks!

  • 5. David  |  January 21, 2008 at 9:12 am

    Many Thanks!!!

  • 6. superjamie . net » Blog Archive » zune  |  January 22, 2008 at 7:04 pm

    […] used for finding files, as the Search function in nautilus actually looks within files. i also got usb proxy working under virtualbox, as i have a new toy to […]

  • 7. Dale  |  February 20, 2008 at 12:25 pm

    Regarding the USB proxy service entry. Did you mean to uncomment the lines in the .etc/init.d/ The lines were already commented in my file. I uncommented them and USB now works on VirtualBox.


  • 8. Paolo  |  February 24, 2008 at 6:48 am

    thanks a lot!

    this page is the final solution for an every day use of vbox

    thank you so much

  • 9. Tommy  |  March 1, 2008 at 5:55 pm

    Thanks very much for the shared folder solution!!!

  • 10. Hexadecimal  |  April 6, 2008 at 4:36 am

    Thank you for a concise explanation on how to solve the USB error!

  • 11. Here  |  April 15, 2008 at 5:29 pm

    “The lines were already commented in my file. I uncommented them and USB now works on VirtualBox.” That;s the wrong thing to do.

  • 12. paulsiu  |  April 21, 2008 at 8:38 am

    Yes, I should have said “Uncomment” on the USB lines. Thank you Dale and Here for the correction.

  • 13. PILCH Hartmut  |  April 30, 2008 at 2:34 pm

    I am facing an even more bewildering issue. When I, as root, say

    mount -t vboxsf foldi /foldi

    (foldi being the name of a shared folder created from the vbox menu, /foldi that of an existing directory), I get the error message

    mount: unknown file system type vboxsf

    I am getting this although my guest system, suse 10.3, has the main virtualbox-related packages installed.

  • 14. Ken Weiner  |  May 5, 2008 at 11:50 pm

    Thank you very much. Many other web pages mentioned that you need to uncomment the lines in /etc/init.d/ but this was the only web page I found that mentions that you have to edit /etc/udev/rules.d/40-permissions.rules too.

  • 15. Reynold  |  May 9, 2008 at 12:17 am

    Thanks!!! I was able to mount the shared folders after reading your instructions.

  • 16. VirtualBox « Me and U(buntu)  |  May 11, 2008 at 12:32 pm

    […] This is a bit complicated as you have to set up some permissions and there are many slight variations all around the web telling you how to do this. One blog entry that helped me was here. […]

  • 17. Anonymous  |  May 18, 2008 at 11:16 am

    Thankx a lot!

    You did a great job.

    If I didn’t reach here I would not know that the SHARENAME is the name we give to the folder!

  • 18. dani  |  June 1, 2008 at 4:36 am

    great! thanks a lot!

  • 19. Mark W  |  August 31, 2008 at 7:50 am

    I had the same error:
    /sbin/mount.vboxsf: mounting failed with the error: Protocol error

    I found my problem was that I was trying to mount a very long sharename (12chars long). I reduced it to 8 chars and was able to mount. Hope this helps someone else…

  • 20. joppe  |  November 13, 2008 at 5:02 am

    the short name worked instantly!! first I had Documents (9) then I tried pipe (4)
    it just worked…. strange, maybe the capital has a role
    as well?

  • 21. g2  |  November 14, 2008 at 4:42 am

    You just save my life!

  • 22. robert  |  November 20, 2008 at 7:14 pm

    Hi, nice post.
    OS X host, openSUSE10.3 guest.

    My shared folder is suse. So I should use the following?
    mount -t vboxsf -o uid=robert suse /home/robert/suse

    “have the login script mount the shared directory to this home directory as the user”
    Not sure what this means. When I try this in the terminal it gives me the same error as already mentioned.

    Thanks for your help

  • 23. Kubuntu 8.10 auf Virtualbox 2 » all-IT  |  November 22, 2008 at 8:47 am

    […] [3] lowendmac – VirtualBox: A Free, Open Source Way to Run Windows and Linux on Your Intel Mac [4] The Bonobo Journal – Tips on running Sun Virtualbox [5] ubuntuusers – Flash installieren Lesezeichen […]

  • […] 原因分析可以看Tips on running Sun Virtualbox的Shared Folder on a Linux Guest节。 […]

  • 25. Ales  |  December 16, 2008 at 3:24 am

    What should I do if I do not have those lines in /etc/init.d/ (host is Ubuntu Intrepid Ibix). Should I paste them somewhere in the file? Where?

  • 27. Sergio Figueroa  |  January 15, 2009 at 9:11 am

    Muchas gracias por el Tips respecto al uso del USB para Virtualbox.
    También sirve para vmware.

    Thanks for de great Tips about the USB use.
    The same procedure use for virtual machine on Vmware.

  • 28. mike  |  January 18, 2009 at 6:07 am

    aXb5I3 hi! how you doin?

  • 29. panna  |  January 26, 2009 at 4:41 am

    i am using windows xp in my mandriva linux discovery 2007 through virtual box. my processor is celeron 1.8ghz, ram 1gb, motherboard asrock 9245 chipset video memory 224
    everything is going on properly but i canT play any game in windows xp not even any ordinary game, whenever i try it shows install your video and graphics card properly. i dont have anyone around me to help. is there any one to help me?
    i need another help, my usb port dies nto work in windows xp.
    is there anyother software except sun virtual box that i can download?

  • 30. miau  |  January 26, 2009 at 4:26 pm

    thanks. that protocol thing is quite confusing.

  • 31. wei  |  March 10, 2009 at 9:59 am

    Thanks for the tip on the “Protocol error” when mounting a share in Linux. That is not just confusing, it is bad software design.

  • 32. tsolox  |  March 10, 2009 at 12:10 pm

    man, you are a genius!!! that renaming of share foldername is incredible!!! Gazillion thanks !!! ^ gazillion!

  • 33. jeremiah foster  |  March 17, 2009 at 9:12 am

    Yeah, that shared folder renaming bit me too. Bizarre.

    Thanks for the tip!

  • 34. Arvind Singh  |  June 4, 2009 at 8:21 pm

    What about “Could not load the Host USB Proxy Service” under windows host specifically Windows server 2008 x64 with VB 2.1.4, how to solve under windows?

  • 35. Erik Itland  |  June 12, 2009 at 7:24 am

    Thanks for your post!

    Regarding your observation “Apparently, you’ll only get this error if you use the default sharename.”, it seems to me that the real reason is that you have a folder with the same name in you current working directory (I didn’t find this out myself, – found it here

  • 36. Arne P.  |  September 4, 2009 at 3:12 am

    Thanks for this great post, there is a lot of helpful information in it! Saved me a lot of time and trouble!

  • 37. Pigletto  |  October 5, 2009 at 6:59 am

    If you get: “mounting failed with the error: Protocol error” try to change current working directory eg. to parent folder.

    In my case:
    mountpoint: /mnt/downloads
    sharename: downloads
    current directory: /mnt

    Command: sudo mount -t vboxsf downloads /mnt/downloads
    causes Protocol error

    After changing to root folder with: cd /, same command as abowe works properly.

  • […] at the Windows “Run” prompt. But how do I do this in Linux? I found this thread that tells me exactly […]

  • 39. mounting a host shared disk in a linux virtual machine  |  April 22, 2010 at 5:43 am

    […] on doing this. Thank you. But it needed a long way and not according to the book. See…ek-virtualbox/ Have a nice day, better then any yesterday, […]

  • 40. Edward Ishaq  |  July 21, 2010 at 10:34 am

    About the “Display Auto-Resize” feature that goes out after update.
    I’ve encountered this problem and the solution was fairly simple.
    Just go to command line and run the VBOXADDITIONS_3.2.6_63112\ script.
    It will set things back to normal.

    If you dont have that Disc running you can get it by clicking on “Device”->”Install Guest Additions” then you will need to restart your machine to see it mounted or mount it yourself if you know how.

  • 41. Sudheesh  |  August 2, 2011 at 7:34 pm

    Hi, I need your help! Please !

    I tried to share a drive from my Windows 7 host with my Ubuntu 11.04 guest. — Devices –>Shared Folders–>’+ button’ , then the default shared name was “V_DRIVE” and path: V:\

    I tried to mount this shared drive using the command:
    sudo mount -t vboxsf V_DRIVE /home/sudheesh/V_DRIVE

    Tried : “sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/V_DRIVE
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument

    Tried sudo mount -t vboxsf V_DRIVE /home/sudheesh/Desktop

    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/V_DRIVE
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/Desktop
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf V_DRIVE /home/sudheesh/V_DRIVE
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf -o uid=sudheesh V: /home/sudheesh/vboxshare
    /sbin/mount.vboxsf: mounting failed with the error: No such file or directory
    sudheesh@sudheesh-VirtualBox:~$ sudo mount -t vboxsf -o uid=sudheesh V_DRIVE /home/sudheesh/V_DRIVE
    /sbin/mount.vboxsf: mounting failed with the error: Invalid argument

  • 42. papazz23  |  October 12, 2011 at 7:54 pm

    hey buddy!!
    thank you so much for your tips!!
    now my android device can connected to my xp host at ubuntu!
    god bless you!!

  • 43. Microphone Today Blog  |  May 19, 2012 at 3:05 am

    Audio Guestmodule 1×6 Desktop…

    […] the manual lies, you cannot set the mode. The permission on the shared directory […]…

  • 44. guy  |  August 24, 2012 at 2:34 pm

    thanks for putting this together!

  • 45. teenage free videos porn  |  June 1, 2013 at 4:10 pm

    If you desire to get a great deal from this paragraph then you have to apply these methods to
    your won website.

  • 46. check  |  December 11, 2013 at 8:07 am

    Nice tips, they really helped me a lot instaling virtualbox.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


November 2007
« Oct   Feb »

Most Recent Posts

%d bloggers like this: