What is the BEST and FREE way to START and BOOST your internet business? Click to find out!
Powered by MaxBlogPress 

Run Windows inside Ubuntu – Graphical Linux Desktop OS

Date June 9, 2009

Screenshot of running Windows inside Ubuntu 9.04 Jaunty JackalopeSince I was introduced to Ubuntu – desktop edition of the Linux operating system – I have become a fan. I use it all the time and everyday! Once I fully get used to it, I can fully depend upon it for all my daily work – checking email, surfing, posting forum entries, building or editing my websites, etc. Basically there is nothing I cannot do with Ubuntu for things I did in the past with Windows.

However, I do find I need to use Windows occasionally for the following reasons…

  1. When I want to check the websites I build in Ubuntu with the Firefox browser – I need to see how they look in Internet Explorer (IE) of Windows. Since IE is still the most used browser over the internet, I have to make sure my websites do not look ugly in IE.
  2. When I need to review a Windows software program.
  3. When I need to use the BlackBerry Device Software (only available for Windows) to syn with my BlackBerry Pearl – I can view/add/delete pictures, videos and audios to/on my BlackBerry without any problem – I just have difficulty synchronizing with it and adding mobile applicaitons to it.
  4. When I need to use a Windows application that I purchased in the past – things you paid with your hard-earned money are hard to let go.

Beside above reasons, we do use Windows on daily basis at work as we use Simply Accounting which happens to be a Windows program we have to use for our business :-( So what do we do?

We run Windows INSIDE Ubuntu!

Yes, that is what we do at work and I do at home. The screenshot image you see above shows that I am actually running Windows inside Ubuntu while preparing for this post on my personal computer at home. Fortunately I do not have to run Simply Accounting on this computer – it shows that I am running my favorite graphic software in Windows – Paint Shop Pro. BTW, Ubuntu does have a counterpart software called GIMP Image Editor installed by default but since I know Paint Shop Pro like my hands I do go back using it when I need to do something I do not know how with GIMP Image Editor.

So how to install Windows inside Ubuntu? Here are the steps…

First you need to install Sun’s VirtualBox for Ubuntu. It comes with Ubuntu Jaunty Jackalope (the most recent version as of this writing, released in April 2009). You can use either the “Applications > Add/Remove” or “System > Administration > Synaptic Package Manager” to do it. It is pretty simple and easy. Alternatively, you can download the .DEB install file directly from Sun’s VirtualBox website as Sun always has the most fresh version of VirtualBox. Installing from the .DEB file is also very easy as Ubuntu has an application to do just that.

Secondly, you need to create a new virtual machine from the installed VirtualBox. In my case, I created a virtual machine for Windows XP. You may want to create a virtual machine for Windows 7, which is the most recent version. During this process, you need to assign Base Memory (RAM) and Video Memory for the machine you are creating. You also need to assign the size for hard disk for Windows. Basically you need to go through all the settings for the following categories:

  • General
  • Hard Disks
  • CD/DVD-ROM
  • Floppy
  • Audio
  • Network
  • Serial Ports
  • USB
  • Shared Folders
  • Remote Display

The most important part is the Shared Folders. You need to create or assign at least one folder in Ubuntu where you want both Windows and Ubuntu to be able to access to. Another is CD/DVD-ROM as you are going to use it to install Windows. For most of the rest settings, you can add or change it after you finished installing Windows in VirtualBox.

The last step – install Windows. If you installed Windows in the past, then this is not new to you. Basically you need to insert the installation CD and set the booting sequence to boot the CD first in the virtual machine.

After installing Windows, you may find that you need to fine tune VirtualBox settings to get audio and USB working properly. In my case, I find the most important thing is to be able to share a common clipboard between Ubuntu and Windows so that I can copy and paste back and forth between the two with ease. This is done under “Settings > General > Advanced” – the setting for “Shared Clipboard” should be “Bidirectional” and NOT any of the rest options listed there. But in order to get it work, you have to install Guest Additions – an application Sun made for Windows to interact between Linux and Windows. Note that you can only install Guest Additions after starting Windows in VirtualBox. Here is how to install Guest Additions…

  1. Click “Start” in VirtualBox to start Windows in Ubuntu – a new Ubuntu/Sun Virtual window will pop up.
  2. You will see these three items in the top left corner of this new popped up window: “Machine”, “Devices” and “Help”. While Windows is fully loaded, click on “Devices” and you will see at the bottom of the list “Install Guest Additions…” – click on this item to start the install process.
  3. After installing all needed additions – determined by VirtualBox settings you selected – you need to restart Windows.
  4. Now test if you can copy/paste back and forth between Windows and Ubuntu – I know I can :-)

Another problem you may have in VirtualBox is with USB. You may, like me, need to synchronize the data saved on my BlackBerry with that on my computer. Once in a while I need to add applications to my BlackBerry using BB’s Desktop Software. Unfortuanlly, BlackBerry has not considered us the users of Ubuntu :-(

Anyway, if you have problem with USB in Windows run via VirtualBox, just follow the following steps to get it work…

  1. Select “System > Administration > Users and Groups
  2. Click the lock icon (beside which it says “click to make changes”) to unlock – enter your admin password to continue
  3. You should see at least two usernames: one is your admin username and one is root. With your admin username is highlighted, click the Properties button. Make sure the checkbox “Use VirtualBox” is checked.
  4. If you have a printer connected to your computer via a USB cable, you need to click the big “Manage Groups” button and make sure your username is checked in the properties of the group called “lp” (standing for line printer?). This will make all programs running inside Windows to use that USB printer.

That’s it! If you are comfortable with the command line, do these:

  1. Start the command line terminal by clicking “Applications > Accessories > Terminal”
  2. Type the following command to add yourself in the vboxusers group. Let’s assume your Ubuntu login username is johnsmith, type this:

    sudo adduser johnsmith vboxusers

  3. Find the devgid of VirtualBox for your username – type this:

    grep vboxusers /etc/group

    and you will see something like this in response:

    vboxusers:x:125:johnsmith

  4. Now type this to open the file of /etc/fstab:

    sudo gedit /etc/fstab

  5. At the very end of the file, add this line:

    none /proc/bus/usb usbfs devgid=125,devmode=664 0 0

    Note that the devgid number on this line should match the number that is returned by the grep command above.

  6. Restart Ubuntu for the changes to take effect.

Now run VirtualBox and Windows, you should not have problem connecting to any devices via USB in this virtual Windows operating system.

If you still have problem with Windows not recognizing any USB devices, even though these devices are listed (not grayed out) on the right bottom bar of the VirtualBox window, then this should fix the problem once for all…

Start VirtualBox and then click on Settings. Then click on USB, you will see two check boxes: Enable USB Controller and Enable USB 2.0 (EHCI) Controller. Make sure the first box is checked. If both boxes are checked, try to uncheck the second one and see what happens. I have a new HP computer (tri-core, the very computer I am using to edit this post) that I have checked both boxes and it works without any problem. However, at work we have a relatively old HP computer (dual-core) and it is running Linux Mint 8 (a variation of Ubuntu) – on this computer VirtualBox can see all USB devices but Windows XP could only recognize only one USB device (Samsung SCX-4521F printer) but not any other devices connected to the computer. It did not even recognize Samsung CLX-2160 printer. I tried everything I could think of, nothing worked until I decided to UNCHECK Enable USB 2.0 (EHCI) Controller. Boom! all other USB devices were recognized instantly :-)

Update (June 17, 2009): If you need to reinstall VirtualBox, for example, removing the not-the-most-updated-version of VirtualBox that comes with Ubuntu and then installing the VirtualBox directly from Sun’s VirtualBox website which is always the most updated version, then you DO NOT NEED to reinstall Windows or whatever OS in the VirtualBox. VirtualBox, as its name implies, it is indeed a virtual box where you can empty it or change its shell without changing its contents.

Where is the content of the VirtualBox located? It is by default in a hidden folder called .VirtualBox in the home folder of the primary admin user. Open the home folder by activating “View > Show Hidden Files” from the top menu and you will see it. You can back up or move it to another computer simply by copying the entire folder. This is neat as you can install Windows or whatever OS in VirtualBox once and use it on another computer without reinstalling. Remember, it is a virtual box. Removing one version of VirtualBox and installing another does not remove this folder as this folder is like the data folder for whatever virtual machines you have in VirtualBox. The reinstalled VirtualBox automatically recognizes this folder and use the settings and data saved there.

Be prepared. Depending on the size of the hard disk(s) you set, this folder can be very big – imagine you have the entire Windows installation packed inside this folder! I just switched VirtualBox from the one that comes with Ubuntu to Sun’s own version and I know the size of this folder for me is 8 GB, which was what I set when I first installed Windows XP inside Ubuntu via VirtualBox.

Update (Feb 6, 2010): I have found a better derivative of Ubuntu. It is called Linux Mint, everything is the same as Ubuntu but LOOKS nicer. The menu arrangement is very similar to Windows so you won’t feel strange at all. I like both Ubuntu and Linux Mint so much I set up these three websites to spread the Linux fire: UbuntuLinuxMint.org (helping with install and use), UbuntuLinuxMint.com (helping with the development of Linux programs), and FasterPCThanWindows.com (explain why a Linux PC can run fast and stay fast).

If you have any questions related to above, please use the comment box below.

Incoming search terms:

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

2 Responses to “Run Windows inside Ubuntu – Graphical Linux Desktop OS”

  1. firstohit said:

    such a nice tutorial. I like commandline alternative of same thing is nice. Also solved my problem with usb grayed out in virtualbox. Thank you so much

  2. Cayle said:

    Thanks for the info. I have recently just installed windows 7 inside ubuntu and i followed your procedure and i still cant seem to copy and paste my files from ubuntu to windows. Also windows doesnt recognize my external hard drive or USB.

    The main reason i installed windows is to get my recording software to work (Reason and Albeton Live). Now will this be a good idea as i know it will take up a lot of memory and will it work? Any help is much appreciated. Cheers

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

For spam filtering purposes, please copy the number 5483 to the field below:

Switch to our mobile site