How To Do Seamless Window and Folder Integration with Ubuntu & VirtualBox

By | 2008/02/01

As promised in yesterdays post I’m going to outline today how to setup seamless window integration with Ubuntu and Virtualbox. If you missed yesterday’s post you might want to take a look at the seamless integration screenshot. No, that is not Photoshop’d, its really my desktop. I’ll also outline how to setup a shared folder between the two systems so that the icons and folders available on your XP desktop are available on your Ubuntu dekstop. So lets go ahead and dive in.

Installing VirtualBox

If you’ve already got VirtualBox installed you can skip ahead here down to Activating Seamless Integration. If not we’ll be starting you from scratch. Fortunately Ubuntu has packages for VirtualBox available in the repositories. I have a previous post on installing VirtualBox, but we’ll repeat the steps here:

sudo aptitude install virtualbox-ose virtualbox-ose-modules

This’ll install VirtualBox Open Source Edition, and should take just a few minutes.

After the installation is finished you’ll need to do just one of the following.

  • Add yourself to the vboxdrv group (sudo usermod -G vboxusers -a username), and then re-login.
  • change permissions on the vboxdrv device (sudo chmod 666 /dev/vboxdrv)

You should now have VirtualBox listed in your Applications menu (Applications > System Tools > Innotek VirtualBox). Go ahead and launch this and install Windows. (I wont get into details on Windows installation, I’m hoping you can figure that much out on your own.)

Activating Seamless Integration

With the release of VirtualBox 1.5.0 (the version you just installed via the Ubuntu repositories) Innotek added the seamless integration feature. This is similar to what is available on Parallels on Mac, allowing you to run individual applications from a virtual environment seamlessly on your native desktop.

Once your guest machine is running and logged in you can activate seamless mode via a shortcut key. Now I want to note that you might double-check to see what your “Host Key” is set to before you dive into this. This proved problematic for me on my MacBook as the default key is right-ctrl, but there is no right-ctrl on the MacBook.

Navigate to (File > Preferences) inside the main VirtualBox window, select the “Input” option and verify or set your “Host” Key” before you go forward.

You’ll also need to install Guest Additions on the Windows guest for this to be available.  See the mention in the next section on how to do that.

Once you’re sure what your “Host Key” is, go back into your running Windows guest and activate seamless mode by hitting:

"Host Key"+L

This should make everything but the Start menu disappear, allowing you to launch individual applications as you normally would. You may want to move your bottom gnome panel to the top for better integration.

Configuring Shared Folder Integration

One additional thing you might want to setup is shared folder integration. What I mean by this is having the files from your Ubuntu desktop appear on your Windows desktop as well. This might be useful, for instance, if you launched Internet Exploder via your integrated Start menu and downloaded a file. The saved file would then appear on your native Ubuntu desktop, via the shared folder system.

First we’ll need to install the VirtualBox Guest Additions. I haven’t yet blogged about how to do this on Windows guests, but you might refer to my previous post on Installing Guest Additions for Ubuntu Guests. Hopefully this’ll be enough until I write a proper article on the topic.

Next activate virtual shared folder support in your guest OS (Windows). Do this via the main VirtualBox window, selecting (Machine > Settings > “Shared Folders”). Click the button to add a shared folder (the top right icon), and define the path to your share. You’ll likely want to share your current Desktop, so you might select:

/home/username/Desktop

Now, toggling back to your Windows guest, you’ll want to mount this shared folder. You’ll need to open a shell using (Start > Run > “cmd“). Then use the following command to “mount” this shared folder between your Ubuntu host and your Windows guest.

net use x: \vboxsvrDesktop

You should now have access to your shared folder, but we also want to tell Windows to use this as its primary folder.

Start up regedit via (Start > Run > “regedit“) and navigate to the following location:

(HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > User Shell Folders)

Look for the key “Desktop” and change the value to:

x:

Save your changes, reboot your Windows guest and you should be done.

I realize this post ended up a bit longer than I expected, but hopefully its comprehensive enough to make it easy to follow. I am really impressed with VirtualBox Open Source Edition, and this even improves my opinion of it!

41 thoughts on “How To Do Seamless Window and Folder Integration with Ubuntu & VirtualBox

  1. deric

    Hello! thanks for the tutorial. I really like the teaser that you posted yesterday. I believe this will be a great help for me. Also can I make use of your tutorial as well on my site? of course with link back to you ;)

    Reply
  2. Phil Thane

    Doesn’t work on Kubuntu (Gutsy) I’ve used V Box and Win XP for a while, but Host Key + L has no effect at all. Is this a KDE v Gnome thing?

    Reply
  3. Christer Edwards Post author

    @deric – as long as your reproduction abides by the content license (attribution required, non-commercial use) you’re welcome to make use of it on your site.

    Reply
  4. Tom Haddon

    Is it possible to use this to run just specific applications without having to show the Windows task bar?

    Reply
  5. cyneuron

    use should have suggested to install latest and personal user version of virtualbox. they have ubuntu repo. check out on their website.

    it has more features (i think regarding usb support and all)….

    Reply
  6. Alex Mayorga Adame

    Can this be done on an already existent win32 partition instead of a clean install?
    If so, please elaborate.

    Thanks in advance.

    Reply
  7. Chris Peplin

    Wow, this looks immensely simpler than the way I’ve done seamless before, which involved all sorts of patches, registry tweaks and rdesktop. I will have to try it out, although I don’t yearn much for Windows these days.

    Reply
  8. AndrewYoungIsGreat

    Thanks, this has prompted me try a virtual machine?

    I’m having trouble with Kubuntu 7.10.

    sudo usermod -G vboxusers -a username works, but

    sudo chmod 666 /dev/vboxdrv

    gives chmod: cannot access `/dev/vboxdrv’: No such file or directory

    What can I do?

    Reply
  9. AndrewYoungIsGreat

    I found a shortcut for Innotek VirtualBox) in System, which I have just run and tried to create a Windows 2000 VM.

    I glided through the setup very without any problems, until I came to start the VM. I had the following error

    VirtualBox kernel driver not installed. The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Please install the virtualbox-ose-modules package for your kernel and execute ‘/etc/init.d/vboxdrv start’ as root.
    VBox status code: -1908 (VERR_VM_DRIVER_NOT_INSTALLED).

    Result Code:
    0×80004005
    Component:
    Console
    Interface:
    IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}

    I have now tried

    sudo /etc/init.d/vboxdrv start

    and /dev/vboxdrv has appeared.

    It’s amazing, I’m now installing Windows 2000.

    Thank you.

    Reply
  10. MetalMusicAddict

    2 things are needed.

    1) You *MUST* “Install Guest additions”
    This will mount a Cd in the windows virtual machine. Double-click on that image and let it do its thing. (it will want to reboot the VM)

    2) You MUST click “Auto-resize Guest display” in the “Machine” menu of the VM.

    After this, “Host Key”+L will work.

    -Cory \m/

    Reply
  11. MetalMusicAddict

    I’ll chime in here again.

    Couple of things:

    1)Compiz. Just turn it off. Caused all kinda graphic glitches.

    2) Set the color to 24bit color in windows. 32-bit causes oddities.

    3) Do not disable “Show window contents while dragging” Crashes VB every time for me.

    4) Set video players to use something other than DirectX rendering. All I get are black screens if I do.

    -Cory \m/

    Reply
  12. rpotter28

    Metal: Thanks for the tip on Compiz! Turned it off, no more screwed up graphics.

    Reply
  13. TechP

    If you have a windows host and Ubuntu running as a virtual OS this is how you do folder sharing :Install guest additions. This is an Iso image that the program will automatically download for you and it’s gone be available in Ubuntu as a cdrom.

    Open the cdrom folder ( in Ubuntu )

    * cd /media/cdrom
    * ls
    * bash VBoxLinuxAdditions.run

    This will install a binary file called mount.vboxsf that will be able to mount the shared folder from your Xp.

    After you run the bash mount the shared folder using

    sudo mount.vboxsh SharedName FolderInUbuntu

    Reply
  14. Jann Roger

    Hi.. Nice work.. :)

    When I’m using this seamless thing, and using maximiced windows (in ubuntu) the win taskbar gets behind the windows.. Is there a way to have it as an panel-ish thing? Thanx for any advice.. :)

    Reply
  15. Jimmy (pak33m)

    Could anybody help me with doing the opposite:

    Windows host with Ubuntu guest?

    Thanks,

    Jimmy (pak33m)

    Reply
  16. Emil

    I’m am little confused and a little noob: I have Ubuntu/XP dualboot. This guide only applies if you do a clean install of windows, right?

    Reply
  17. dean

    hey guys, i cant seem to get unity to work on either vmware workstation beta or virtual box, im running tinyxp pro . . . do you think it would have somehting to do with the graphics or the os?

    Reply
  18. Robin

    Can you suggest how I can get to see the VB window. The VM window immediately disappears after loading. All I can do is close the icon for the VM, it allows me to save the machine state. I am using Hardy H.

    Is there a control file which I can edit to revert to non seamless?

    Robin

    Reply
  19. Andy

    I have the same problem as Robin (I think). When I switch to seamless, my guest desktop (with active apps) disappears. I can select it using the windows menu from the ubuntu desktop (middle button), and if I start (for example) a CMD window, it is visible once I use Host-L to go back to non-seamless mode.

    Reply
  20. Ashley

    You sir, are a genius. Full props to you, Ubuntu and XP (guest) at the same time is unholy. ^_^

    Reply
  21. djn1

    I found this vv,useful – wish I had found it earlier. I followed the integration of Kubuntu with guest virtualbox WindowsXP and it is now working. Thanks!

    Reply
  22. vaggos

    Thanx a lot. The shared folder part worked for me like a charm!!!

    Reply
  23. Alistair

    Is it possible to completely hide the windows taskbar as well and launch windows applications from within the host OS?

    Reply
  24. Thanks

    Thanks MAN- all i needed was this one line:
    if you have a linux host you need to map your share on the guest by typing this on the windows guest os at command prompt:

    net use x: \\vboxsvr\FILE_SHARE_NAME

    Reply
  25. John Howell

    Neat, but I am using OS X as a host, Virtualbox 2.2.2 and Ubuntu 9.0.4 as the guest. Is there a way to get the ubuntu windows seamless in OS X?

    Reply
  26. brokerboystway

    dude this is the best guide ever written. i know its kind of late but. i hope you have more tuts for tux (made a funny)

    the migration is over i have officially moved to tux. hey hey hey good bye!
    linux mint 6 hp dv6875se 3g ram 1.83 t5550 intel core duo centrino inside.
    break a window!

    Reply
  27. eclecnant

    Worked like a charm on Ubuntu Karmic with Windows XP as guest. Thanks!

    Reply
  28. JaY0

    A tip for those who don’t want VirtualBox to be shown in their taskbar/Gnomebar. Install Compiz settings configurator, then enable Window Rules, then in the first available entry box where it says “Skip taskbar” you type in “class=VirtualBox” (without quotes) and presto!

    Good guide by the way.

    Reply
  29. tommy

    doesn’t work here on ubuntu 10.04 latest virutal box..runnin xp guest.. when i run the \\vboxsvr\Downloads [downloads the shared folder in home\username\Downloads

    NETWORK NOT FOUND!!!

    Reply
  30. Buddhika Ranasinghe

    Thanks in advance
    I’ve resolved my problem.

    Reply
  31. Sumit Bisht

    Thanks!
    Your approach worked great on my machine.
    BTW:I had installed Guest Additions already on my Windows guest.

    Reply
  32. Steve

    @Alex Mayorga Adame: Yes you can migrate an existing Windows partition to a VirtualBox VM, but you need to prepare it first via some reg edits and you need to set your virtualbox settings to roughly match your PC (presence of IOAPIC, etc [more technically in windows lingo you need to have a setup where the HAL required for both the original PC and the virtualbox VM is the same]). See http://www.virtualbox.org/wiki/Migrate_Windows. I actually have a windows partition that I can boot stand-alone or from within VBox, although it does mean that before I switch from one to the other I have to mount the partition in linux and switch the windows activation file around (I have one copy that’s happy with the VBox setup and the original copy that’s happy with the native PC hardware). Hope this helps!

    Reply
  33. Jan Greeff

    My Virtualbox did not install via the terminal, so I installed it via the software centre. It did not appear in the system tools, it showed up in accessories. Needless to say, none of the instructions worked after that. Is there a way out of here towards seamless integration?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *