View Full Version : [ubuntu] 10.04 Lucid in Windows 7 - Microsoft Virtual PC

Rhidalin Bytes
August 15th, 2010, 06:51 AM
Found a few postings on this and all the information I found was scattered across several websites. I take no credit for this other than taking the time to do a few screenshots. It's a lot more useful to the community than one might think. I posted this for my friends on a small BBS and at least 3 people since have been 'playing around' in Ubuntu so here ya go. It's much more comprehensive and end user friendly than any I've seen yet.

*** WARNING ****
Do not attempt to make any changes to your operating system without fully understanding and accepting that if you screw up, you get to start from scratch. This tutorial involves editing files and folders independent from your Operating system and is relatively safe.

From this point, we'll assume your running Windows 7 and have Virtual PC installed. And before anyone thinks "Hey, what about VMWare or blah blah blah", don't clutter this thread, if they want to do that, they'll Search for Ubuntu on VMWare (http://www.google.com/search?q=Ubuntu+VMware+install+Windows+7) :wink)

**** Begin Tutorial *****
I wanted to run a couple linux apps without rebooting my machine. What follows is an exploration in self mutilation and approaches voluntary masochism. I have discovered that while patience is a virtue, there is nothing virtuous about her. After reading over and over article after article on how you can't use Microcrap's built in Virtual PC for Windows 7, you have to use 3rd party to run a Linux VM. I called ******** and found some lingering threads buried deep within the ubuntu forums. This example is kind of thorough (http://ubuntuforums.org/showthread.php?t=1466888) although it lacks the ease of use for people who don't know what they are doing.

A little primer on virtual machines. A virtual machine is a translatable snapshot of an operating system that will play on any machine. It does so by providing a known set of generic hardware with varying levels of complexity based on which OS is running on which machine. In this example, a copy of Ubuntu Linux 10.04 (lucid-32bit) is being run within a window on a Windows 7 Professional 64-bit machine.

Now for the why don't you just set up a dual boot machine and take full advantage of the power of the penguin. Well, it's not that easy, for a multitude of reasons. The biggest is convenience. I have instant access to files updated on either machine within the other, without the wait of a reboot just a quick ALT-TAB. I'm also not stuck to just terminal linux commands through a telnet session to another box. I rarely go beyond the terminal prompt in normal testing, however there are some network tools and testing consoles that I prefer in Linux. And yes, I do have a dual boot option should I want to flaunt my super 64-bit penguin power.

So, on with the story... After spending nearly a day trying this and that and seeing who did what and what wasn't working on my machine, it boiled down to what can Windows Virtual PC do, what hardware does it present to an operating system when it's enhancements are turned completely off (coincidence they would only support RedHat linux? I think not, see approved government operating systems).

When getting setup to start your image, you need a few large downloads, and you need to make your list before you start the process, so you can walk away and watch some tube or mow the lawn.

Files needed to get you started: (these will not change typically)
Microsoft Virtual PC (http://www.microsoft.com/windows/virtual-pc/download.aspx)
There will most likely be 3 downloads for this. The upside is you get a "free copy" of windows XP professional out of it.
The next file you will need is an ISO of the version of Linux you would like
I chose Ubuntu 10.04 32bit, but this will work on most debian kernels
I do not recommend 64 bit linux anything at this point unless you dual boot only, it's problematic.
Do not burn the ISO to a DVD or CD (I'll explain why later)

Okay, we have all we need downloaded to a common location that we remember right? Great, let's get started installing Microsoft Virtual PC.

If your install is similar to mine, you'll install in this order:

Of course change to -i386 if your running 32 bit Windows 7.

Now that we have this installed, reboot the computer, after you log back in, check for windows updates by start button and type 'wuauclt /detectnow' without the quotes. Install any updates and reboot yet again.

Now we've prepped the computer for adding Virtual PC's. If you want to see what a virtual machine will be like, you can go ahead and run the Windows XP Mode and see how nifty it is to have a clean system to try software on (that's isolated from your real system of course.)

Now on to creating some penguin powered windows. Open Windows Virtual PC. You will see a file explorer type of window with the option to Organize, Include in library, Share with, Burn, Create virtual machine, New folder.


Select 'Create virtual machine'

This will open up a wizard that we will use to setup the environment for Linux. Because this is not a Microsoft innovation, we want it to be as stable as possible.


Type in the name you'd like to use, something to identify the OS you intend to install, I used AnotherOS but I would choose something more memorable, especially if you plan on creating multipe VM's

The Location should be set for you, although you may put it on another Hard Drive if you would like (perhaps you don't want to allocate space on your SSD and prefer it on your SATA drive)


Now for RAM, this is the amount of ram that will be reported to the new operating system, in this example I chose 512, I would recommend at least 1024 if you plan on doing anything graphically intense. For the most part, this will be a chunk of real memory that Windows 7 will not be able to use while the virtual machine is active. You don't want to set it to 3096 if you only have 4096 available and then try to run Autocad on Windows 7 and open your pocket Linux to do some geological survey conversions.

Networking, just leave this checked, we'll address this later. On with the show


We want to create a virtual hard disk using advanced options. NEXT Choosing Fixed size because we want this to be as stable as possible.


As far as name and location, it's typically simpler to keep it the same. It will have a different extension so NEXT.


Now we specify a size. For reference, a typical Linux install, including swap drive portion is around 5gb (assuming you end up installing nearly every package available). I chose 16384 because that was the number that popped up and it was big enough to download nearly anything I could ever want to.


Now we are ready to hit Create. You should see this screen


and assuming everything happens like it's supposed to, you may close the window.

Rhidalin Bytes
August 15th, 2010, 06:53 AM

Now we need to do some more editing. Click on the virtual machine we just created and select setting. It will bring up a windows like so....


Select the DVD Drive and we want Open an ISO image. Remember where you put that? I hope so, now we need it :)

For Networking, if it hasn't already selected it, we want Shared Networking (NAT)


Okay, ciick open on your name.vmcx and begin hitting your F4 key. Be pressing F4 occasionally until you see the language selection screen.


Once you see the language selection screen, unless you need a language other than english, press escape. Now press F6 and you will see another menu pop up, hit escape once to remove menu.


Hit your backspace key to get rid of 'quiet splash - ' replace it with 'vga=788 noreplace-paravirt'


Now you hit enter and it will Try Ubuntu without changing your current system. If you see something like this, your in business.


and then, this

Rhidalin Bytes
August 15th, 2010, 06:55 AM

Once you get to the desktop, double click on the Install Ubuntu and follow the prompts. When it asks where to install, use the largest portion of sda1 (the default virtual hard drive).


Remember to tell it who you are and that password will be very important, even if you chose to login automatically.


You should be at this point and can go get a cup of coffee, this will take about 5 to 10 minutes, depending on your system.


When you return, you should see this. We want to Continue Testing. We've got some work to do before we reboot this thing.


Before we can work on our newly installed virtual hard drive, we need to let Linux know it's there. The easiest way to do this is to open it from the Places menu. This will mount the drive in our media folder.


Now close the window that opens, we don't need it. (you'll notice the drive icon is added to your desktop, that's supposed to happen). We will need a Terminal window, this is the equivalent of Windows CMD.exe windows. Nothing fancy, just a prompt waiting for input.


We have quite a bit to do here. First off we need to become a super admin so that we have complete and Ultimate POWER, muwahahaha....


Rhidalin Bytes
August 15th, 2010, 06:56 AM
Er, uhm, yea, type in sudo -i and it will change our prompt to root@ubuntu, root is a powerful fella so watch the typos.

Next we need to go to media and find out the ID of our virtual hard drive

cd /media

Now that is one long *** number and looks like a CD key....yea, sort of, not really but we don't need to remember the WHOLE number, anytime you need to enter that number, type the first two numbers and then hit tab (make sure you don't put double /'s).

Next we need to mount our devices

mount -o bind /dev /media/reallylongnumber/dev

Then we change the root of our system to the new hard drive

chroot /media/reallylongnumber

Now we run the command prompt from the new system


Lastly, we need some procedures, so we'll

mount -t proc none /proc

And now we get to edit our boot loader using nano (think notepad)

nano /etc/default/grub

This brings up a screen like this



change "quiet splash" to "noreplace-paravirt vga=788"


Now hit CTRL-X and it will ask whether to save, hit yes and then enter

Now we need to edit more grub files, type this

nano /etc/grub.d/10_linux

This brings up a rather daunting screen. Using your page down key and up and down arrow keys, find this portion of the file.


We need to add something to the args="$4", add noreplace-paravirt vga=788 so it looks like this


Hit CTRL-X then ENTER to save the changes.

Now we need to tell linux that we made those changes. Type in:


Your screen will go nuts and will look like this.


Now we are ready to reboot, type in:

reboot now

A screen like this will appear and once it shows casper is resyncing, just hit ENTER, yea, that one took me ages to figure out....DO NOT close the window, it will close itself after you hit ENTER.

note: A little tidbit for you linux gurus, this is where the install iso is asking you to remove the cd and press enter to continue, for some reason, that screen doesn't want to display.


Now you should have a working ubuntu linux install. When the system reboots, you should see.


and then

Rhidalin Bytes
August 15th, 2010, 06:58 AM

There are a few quirks to this, it captures the mouse which you can release with CTRL-ALT-LEFTARROW and the scroll doesn't work. If I get through those limitations, I'll update this.

Enjoy your new penguin powered window :)

Rhidalin Bytes
August 15th, 2010, 07:03 AM
Now for the pesky resolution problem, we're stuck at 800x600 by default in Ubuntu 10.04 while running in Virtual PC. We cannot install extra tools because Microsoft doesn't have a deb copy of the tools. So we get to dive into some really interesting terminal commands. Stay resolute and we'll fix our resolution.

First off, boot up your Ubuntu VM and select recovery mode:

You'll now see this screen and we want to resume normal boot because we're not actually recovering anything.

Now lets get to a Super User prompt - SUDo

X11 is the default GUI for Ubuntu. You'll see references to this quite a bit so now you know what it is. Ubuntu 10.04 felt it necessary to do away with a screen configuration and chose to do things dynamically, meaning, we only have available, what linux can see. Microsoft doesn't let it see much other than an s3 video card and a default monitor (It doesn't even have a name). However, if we create a config file, it will use it.

Let's create a config file based on what linux detects.

root@brian7-ubuntu:~# Xorg -configure

let's make sure it's there
cd /root
should show

Now we are ready to get down and dirty with X11 and tell it what we really want

nano xorg.conf.new

NOTE: A few navigation options for you, page up and page down for whole pages, arrow keys to move the cursor, cut and paste is not an option (check your spelling)

scroll down till you see

we want it to look like this by adding DefaultDepth 16 and the Modes lines for all Depths except 24

Now move to the monitor section and we're going to change it slightly so it thinks it has a capable monitor.

Rhidalin Bytes
August 15th, 2010, 07:04 AM

With all these changes made, we're going to exit nano, saving changes (Y)es and hit enter to use the same file name.

It's time to let X11 know what to do,

root@brian7-ubuntu:~# cp xorg.conf.new /etc/X11/xorg.conf

time to reboot

root@brian7-ubuntu:~# reboot now

and off it goes. Your default resolution should be 1024x768x16bit when you get to the login prompt. Now, considering most are running 1280x1024 or higher, you can experiment with editing /etc/X11/xorg.conf however, you may want to save yourself some headache (in case you goof up the config) by making a backup.

root@brian7-ubuntu:~# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Now for your mouse.... this is really easy. (Time to graduate from pictures)

Open a terminal window (Applications/Accessories/Terminal)

brian@brian7-ubuntu:~$ sudo echo options psmouse proto=imps >> /etc/modprobe.d/psmouse.conf

don't forget to reboot ("sudo reboot now" if you want to skip the mouse clicks)

That's it for the mouse. I'll cover processor timing (enhancing performance) and copy / paste to and from windows at a later time. Enjoy a more pleasant Linux experiance.

"Creating linux users one image at a time"

December 17th, 2010, 06:16 PM
Wow...that's a hell lot of elaboration!! Wonderful man! Am half way through...
Have been trying to get the damn WiFi work in my stand-alone version of Ubuntu (the one installed with dual boot), but no luck after so many trials and playing a lot with some system files in due course. I think, this one will have no network problems since it shares via NAT. Fingers crossed...lets see...will post back if all goes well.

December 17th, 2010, 11:10 PM
Ok, completed the tutorial...but got few glitches in the process. Please see if these could be solved.
I installed Ubuntu successfully completing the first part of your tutorial. But when i started the virtual machine, the grub screen did not appear. I straightaway landed to the login screen. I could easily log in and continue with the work.

For the part two of the tutorial, i needed the grub screen. So i logged in -> updated ubuntu via update manager (it asked whether to keep or get new configuration of grub, since it had been modified, while updating the grub in the process. I kept the original configuration). Now, everytime i start the virtual machine, no grub screen appears. Instead, i am landed in a command line mode with no GUI, no login screen....nothing. It asks me to login at the command line.

[The command line mode is same as the one you get after killing off the gnome GUI process of ubuntu via:
sudo /etc/init.d/gdm stop]

After logging in in command line mode, i can go to GUI mode by using startx command, thereby landing directly in my account(GUI mode).I tried re-installing grub from command line mode...no help. I don't know what caused this, but I am still happy with it.

I carried out the second part of your tutorial from that command line mode itself and got the desired output. If i were to use ubuntu at 1024x768 resolution, why did you add other two configurations along? The thing is that my screen resolution is 1920 x 1080. Now how to get ubuntu to full screen mode of this resolution?

and btw....this was a great help!! Thanks a ton for this tutorial, man!

P.S: the internet on ubuntu wasn't working with NAT configuration. I changed to to my laptop's wireless card in the setting, and now it works great!!

September 2nd, 2011, 05:04 PM
Running 11.04, after install I also don't get the grub screen, plus I get a message that says something like "it seems you do not have the hardware required to run unity, you will go back to ubuntu classic". It's only 1 yr old i7 laptop loaded to the hilt so I'm sure it's capable.

September 2nd, 2011, 07:37 PM
OK ... learned some stuff that might be useful for other newbies like me:

1 - If the grub menu doesn't automatically pop up hold shift down when you reboot (right when the cursor on the empty screen pops to the top of the screen).

2 - If you mess it up and need to do a reinstall, restart the vm, then hold down "Delete" key and it will boot into your CMOS setup (a fake CMOS of course, as it is a VM, but it works just like the real thing) ... change the boot options so it boots to the DVD first.

Note that after you finish the first set of install steps and it reboots, you will then need to hit "Delete" again at reboot and change the boot drive back to the hard drive, otherwise it will try to reinstall ubuntu along side the one you just installed.

3 - I failed "unity" requirements (see earlier comment) because it couldn't access my hardware profile to do component integration (like to enable sound or your mousewheel) ... this is something handled by the VM because those resources are already being used by the Host OS, and the Virtual PC VM makes this possible by creating a virtual CD for the Guest operating system containing a file called setup.exe which can be used by a Guest OS such as XP mode, for example. This file is absolutely worthless for linux, of course.

In otherwords, Microsoft hid these components from "Guest" OSes ... basically any OS other than Windows XP and a couple other Microsoft products. If you want mousewheel functionality or sound then you need to run a different vm like VirtualBox or vmWare. You can also use Hyper-V if your stuck using MS software, but apparently it only works with Redhat.

Had I known that I'd never have started down this path. Seems like it should be noted upfront at the start of every "linux on Virtual PC" tutorial like this.