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 site has been useful, please consider participating in the Fundraiser.

Other Points of Interest

  • No Related Post

Comments

29 Responses to “How To Do Seamless Window and Folder Integration with Ubuntu & VirtualBox”

  1. Vincent on February 1st, 2008 9:12 am

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

  2. deric on February 1st, 2008 9:42 am

    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. Phil Thane on February 1st, 2008 9:44 am

    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. Christer Edwards on February 1st, 2008 9:58 am

    @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 on February 1st, 2008 10:17 am

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

  6. Christer Edwards on February 1st, 2008 10:23 am

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

  7. cyneuron on February 1st, 2008 10:56 am

    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 on February 1st, 2008 11:15 am

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

    Thanks in advance.

  9. Chris Peplin on February 1st, 2008 11:21 am

    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 on February 1st, 2008 11:42 am

    @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. Dax Kelson on February 1st, 2008 11:59 am

    Thanks pretty slick.

  12. AndrewYoungIsGreat on February 1st, 2008 3:05 pm

    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 on February 1st, 2008 3:28 pm

    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 on February 1st, 2008 3:53 pm

    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 on February 1st, 2008 6:08 pm

    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 on February 1st, 2008 6:09 pm
  17. rpotter28 on February 1st, 2008 6:39 pm

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

  18. TechP on February 8th, 2008 12:40 am

    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 on February 11th, 2008 4:48 am

    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) on February 14th, 2008 12:13 pm

    Could anybody help me with doing the opposite:

    Windows host with Ubuntu guest?

    Thanks,

    Jimmy (pak33m)

  21. Emil on February 15th, 2008 11:56 am

    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. Johny on April 23rd, 2008 12:31 am

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

  23. dean on May 3rd, 2008 3:55 pm

    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 on May 5th, 2008 6:23 am

    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 on May 29th, 2008 10:13 am

    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 on September 2nd, 2008 4:11 am

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

  27. djn1 on September 16th, 2008 8:15 am

    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. Plum on November 16th, 2008 1:11 pm

    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 on November 25th, 2008 10:31 am

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

Leave a Comment




    Subscribe to the RSS feed!


    subscribe to the ubuntu tutorials RSS feed

    Ubuntu Tutorials Fundraiser


    Please Donate to
    Server Improvement

    Target amount: USD1,000.00
    Total Donations: USD255.00
    Amount Needed: USD745.00

    Thank you for your support!

    Click to Donate

    Polls



  • Blogroll

  • Ads by Google