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

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

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: \\vboxsvr\Desktop

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!

If this article has been helpful, please consider linking to it.

Related Posts

  1. February 1st, 2008 at 09:12 | #1

    If I’d had Windows I’d try it out :)

  2. February 1st, 2008 at 09:42 | #2

    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 ;)

  3. February 1st, 2008 at 09:44 | #3

    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?

  4. February 1st, 2008 at 09:58 | #4

    @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.

  5. Tom Haddon
    February 1st, 2008 at 10:17 | #5

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

  6. February 1st, 2008 at 10:23 | #6

    @Tom – you could set the taskbar to auto-hide I suppose..

  7. cyneuron
    February 1st, 2008 at 10:56 | #7

    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)….

  8. Alex Mayorga Adame
    February 1st, 2008 at 11:15 | #8

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

    Thanks in advance.

  9. February 1st, 2008 at 11:21 | #9

    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.

  10. jimcooncat
    February 1st, 2008 at 11:42 | #10

    @Tom, there are alternative shells such as LiteStep where you can be more in control of the configuration.

    http://lsdocs.shellfront.org/index.php

  11. February 1st, 2008 at 11:59 | #11

    Thanks pretty slick.

  12. AndrewYoungIsGreat
    February 1st, 2008 at 15:05 | #12

    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?

  13. AndrewYoungIsGreat
    February 1st, 2008 at 15:28 | #13

    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.

  14. MetalMusicAddict
    February 1st, 2008 at 15:53 | #14

    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/

  15. MetalMusicAddict
    February 1st, 2008 at 18:08 | #15

    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/

  16. MetalMusicAddict
    February 1st, 2008 at 18:09 | #16
  17. rpotter28
    February 1st, 2008 at 18:39 | #17

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

  18. February 8th, 2008 at 00:40 | #18

    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

  19. Jann Roger
    February 11th, 2008 at 04:48 | #19

    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.. :)

  20. Jimmy (pak33m)
    February 14th, 2008 at 12:13 | #20

    Could anybody help me with doing the opposite:

    Windows host with Ubuntu guest?

    Thanks,

    Jimmy (pak33m)

  21. Emil
    February 15th, 2008 at 11:56 | #21

    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?

  22. April 23rd, 2008 at 00:31 | #22

    Thanks a lot, from many tutorials only this was working for me :)

  23. dean
    May 3rd, 2008 at 15:55 | #23

    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?

  24. Robin
    May 5th, 2008 at 06:23 | #24

    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

  25. Andy
    May 29th, 2008 at 10:13 | #25

    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.

  26. Ashley
    September 2nd, 2008 at 04:11 | #26

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

  27. djn1
    September 16th, 2008 at 08:15 | #27

    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!

  28. November 16th, 2008 at 13:11 | #28

    Hi,

    I’ve extended VirtualBox to open Word files in a Window Xp Virtual Machine. This method can be generalised to open any file type using Window’s default application.

    For more info, see:
    http://www.pjlnash.co.uk/blog/?p=39

  29. vaggos
    November 25th, 2008 at 10:31 | #29

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

  30. Alistair
    January 16th, 2009 at 16:40 | #30

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

  31. Thanks
    February 3rd, 2009 at 20:20 | #31

    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

  32. May 1st, 2009 at 22:50 | #32

    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?

  33. May 28th, 2009 at 00:27 | #33

    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!

  34. eclecnant
    November 24th, 2009 at 00:12 | #34

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

  35. JaY0
    April 24th, 2010 at 00:00 | #35

    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.

  36. tommy
    May 18th, 2010 at 04:32 | #36

    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!!!