Scott Hanselman

Installing Ubuntu 10.4 LTS on Windows Virtual PC on Windows 7

August 27, 2010 Comment on this post [51] Posted in Tools
Sponsored By

There's lots of info spread around on how to install various older versions of Ubuntu under various older versions of Virtual PC, but I didn't find any referring to the newish Ubuntu 10.4 and VPC on Win 7.

I did now find some useful command-line parameters in this blog post from Mark Wilson. I'm trying to make this post as complete as possible. If you have new or update or better info that is specific to the new changes in Ubuntu 10.4, let me know.

Here's what I did.

  • Download Ubuntu.
  • Download Windows Virtual PC.
  • Go into the Virtual Machines folder, and click Create Virtual Machine. Give you VM at least a gig of RAM. I have 8 gigs on my machine, so I give it probably more than was needed and allocated 3gigs.

Virtual Machines

When you create a Hard Drive, create a Fixed one rather than a dynamic one. I find this is faster and can avoid some strange disk errors with Ubuntu and the VM. I saw some strangeness with dynamically expanding disks.

In the Settings for your VM, tell it that the DVD drive actually be the Ubuntu ISO that you downloaded.

Ubuntu - Windows Virtual PC Settings (2)

Hit OK and start your VM.

IMPORTANT: When it starts booting, hit ESC when you see a blinking cursor, then you'll find yourself here. If you let it just boot without hitting ESC it'll start a bit, then give up.

image

Hit F6, then ESC. Then add vga=791 noreplace-paravirt at the end of the white command line so it looks like:

image

Hit Enter

image

You find yourself at a desktop...make sure that from Tools|Settings that your Network Card in the VM is attached to a REAL physical network card.

image

If you click in your VM, the mouse will be captured. You can get out with Ctrl+Alt+Left Arrow.

image

Double-Click Install Ubuntu and start the process using all the defaults.

image

Blah blah blah...

image

Wait a while...and IMPORTANT do not restart when it's done or you are screwed.

image

Instead, you need to make a few changes to make your new system bootable. Click "Continue Testing."

Now, go to the Places Menu in the top menu and click your File System. That will open up a disk browsing window with a GUID (yes, a GUID) in the title bar. You're going to need to type that, so get emotionally ready. You'll also want to rearrange the windows so you can open up a Terminal Window (from Applications, Accessories) and have the two near each other.

image

Now, open your Terminal. From Marks's blog, type:

sudo mount -o bind /dev /media/THATGUID/dev
sudo chroot /media/THATGUID/ /bin/bash
mount -t proc none /proc
nano /etc/default/grub

That last line will bring up a text editor.

image

From the text editor, change "quiet splash" to VGA=788 or one of the VGA codes from this table. Mark also recommends commenting outu GRUD_HIDDEN_TIMEOUT with a #. Oddly, while the codes for resolutions seem to work initially, X switches back to 800x600 when it starts.

Depth 800×600 1024×768 1152×864
1280×1024 1600×1200
8 bit vga=771 vga=773 vga=353 vga=775 vga=796
16 bit vga=788 vga=791 vga=355 vga=794 vga=798
24 bit vga=789 vga=792   vga=795 vga=799

image

Save with Ctrl-X, then run nano /etc/grub.d/10_linux from the terminal to edit one more file. Add noreplace-paravirt (remember that) after args="$4" like this:

image

Finally, run "update-grub" from the command line. NOW you can restart using the on-off button dealie on in the upper-right corner. I had to hit enter a few times in text mode to get it to finally restart. Ignore the error about Casper and just press enter.

image

At this point with Ubuntu 10.4 on Virtual PC:

  • No sound - faking it with modprobe snd-sb16 doesn't work
  • No mouse wheel - hacks found around don't appear to work
  • Difficult to change resolution.

Of course, using the Virtual Box virtualization tool works great with Ubuntu right out of the box and includes Virtual Additions that are custom to Linux and allow resizing, but I was (am) hoping to get this VPC thing working completely so I can stick with my one standard virtualization solution.

If you've solved any of these, specific to Ubuntu 10.4, then please let me know and I'll update this post.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service
August 27, 2010 14:06
Thanks for such an informative post - being able to experiment with a Linux install whilst being inside Virtual PC is great - I'd heard it was possible but I've never tried it - off to give it a go now!
August 27, 2010 14:49
What issues did you run into with dynamically expanding disks? On a different linux variant, despite rebooting fine, it would claim corrupted filesystem when the undo disks were flattened to the disk no matter what the base disk was. Did you see this issue?
August 27, 2010 14:50
VirtualBox also lets you host 64-bit Ubuntu installations, which is great if you need 64-bit Linux.

But I've found it a bit flaky though, occasional "reboot" of VirtualBox itself required. (Kill, restart).
August 27, 2010 14:52
Don't forget to install Freepascal/Lazarus ... Anyway I think you are on the right way, VPC has never been bad especially with Linux.
August 27, 2010 15:45
So, in summary, use VMWare? ;)
August 27, 2010 17:33
Do people actually use Linux for a desktop? I thought Apple took care of that. :-)
August 27, 2010 18:09
If you forget/ignore Scott's advice to add the vga mode to the grub boot up config (or did not know at the time), it is possible to reboot the VPC by disabling Hardware-assisted Virtualization in the VPC settings and then make the changes are then re-enable the hardware assist.
August 27, 2010 19:05
I prefer VMWare.

The main reason for me is that it's the only VM solution I've encountered that has 3D support in Windows out of the box. VPC doesn't have 3D support at all.

I'm not sure how well VirtualBox does 3D in Linux... but 3D in a VirtualBox Windows VM is a gigantic hack. Literally, as you have to replace some of Windows DLLs to get it working, and it only supports DirectX 8 and 9.
August 27, 2010 19:47
(a) "I saw some strangeness with dynamically expanding disks." That then would clearly be a bug in VirtualPC (by definition: VPC _virtualizes_ so nothing of this should transpire to the guest OS).

(b) I'm pretty sure that Microsoft have contributed to linux guest additions for HyperV, so if you really don't want to use VirtualBox, VMWare or another multiplatform virtualization tool _not_ from Microsoft, HyperV might be an apt choice
August 28, 2010 0:34
If you use VMWorkstation 7, it installs in about 3 clicks from an ISO. I like VMWorkstation much better than VPC plus the fact I can have multi-monitor, DirectX, and all the other bells and whistles.

Now the question is... why are you farting around with Ubunutu Scott? I hope Microsoft doesn't see this post... you'll probably get your PC replaced with Windows for Workgroups 3.5 or something!
August 28, 2010 2:40
It is better to use Wubi, it is the closest to real installation but at the end of the day it is just another program you will uninstall from Windows.
http://wubi-installer.org/
August 28, 2010 6:54
It's not Ubuntu;s strange errors. Use VMWare even the player has no issues and allows you to create new VMs. I ubuntu'd my laptop and VM'd my windows installations.
August 28, 2010 19:57
Forget about Microsoft Virtual PC or VMWare. VirtualBox is literaly STATE OF THE ART.

Besides, if you only need Windows 7 for work, there's no reason to have it as the host system. Replace it with Ubuntu and run Win 7 on a Virtual Box instead.

I sincerely wish I could get rid of Windows completely but unfortunately it's required for work. So exactly the same setup works very well for me. In my case, Windows running as a virtual machine on Ubuntu works even faster than Windows installed on the same physical machine. Go figure.
August 28, 2010 21:14
One more vote for "use wubi" and avoid the headaches (and perf hit). Remember that "install win7 to vhd" post you did? Thats what wubi does, for linux. Only the hd is virtualized.
August 30, 2010 10:02
You should be able to use tab completion in the terminal to avoid typing the GUID.

It doesn't matter if you're using a windows console or a linux terminal, the tab button is your pal.
August 31, 2010 15:52
Scott, I've followed your post to the letter (and checked my actions 4 times). After the reboot I just get a blinking cursor at the command line.

Has anyone else reported issues like this. I'm on Windows 7 64 Bit Pro.
August 31, 2010 19:58
Hi. Can i get some help?

I do this just like the text and the pictures and my ubuntu doesn't work. :S

I log in and the screen goes purple and doesn't happens nothing.



PS: Sorry for my bad english! xD I'm from Portugal.
August 31, 2010 23:10
Thanks a lot ! (but how painful to have to do all this, just to install Ubuntu).
September 01, 2010 6:40
Awesome.Request similar tutorial for installing PCLinuxOS on separate partition where Ubuntu 10.04 and windows already installed.Windows installed first and ubuntu subsequently. I have tried ended up with losing grub and now I am scared to try again.thanks
September 01, 2010 23:58
It's Ubuntu 10.04, not Ubuntu 10.4
September 02, 2010 9:53
I've been a VMWare user since about the first version myself. I used to use Virtual PC on Mac a long while ago but never cared for it. Recently it seems VPC only really does Windows clients well, and they nuked the Mac version. I haven't tried VirtualBox, so can't really comment on it, but VMWare Workstation is my VM host of choice... Well worth the money on avoided headaches, and the only reason I ever need the tools in linux is dynamic screen/window sizing...

Something worth checking out now that you have a *nix VM would be node.js, there is a ton of potential there.
September 03, 2010 8:02
Vmware Wrokstation is way ahead of m$sft virual pc. VPC should be sunset.
September 05, 2010 19:42
Hello,
Thanks for this tutorial.
You could note that it is a great help to use the [tab] auto-completion instead of manually typing the full GUID.
BTW, I have just tried with the beta of Ubuntu 10.10, and I cannot get it to start after having completed all the described steps. I will look again when the 10.10 is released.
September 07, 2010 21:39
I've installed this version and previous, I don't understand the heartburn. The install has been straight forward and simple.

Is this a VM for Idiiots post?
September 07, 2010 21:53
Are you joking? Have you been able to get Ubuntu running under VPC with sound, a scrollwheel and 1024 or higher graphics?
September 07, 2010 22:25
Scroll wheel, not a big concern.

Resolution, is a known pain. You can do after a reboot, so not sure what the worry was there.

Sound, sure, I guess. Maybe I got lucky or an update somehow fixed it.

Does MSFT even support Virtual PC as a standalone download? Like everyone else said, just use VMWare (or other free alternatives) and you won't have this hassle. I'm all for MSFT products but come on. This post would have been great years ago. Now, not so much.
September 07, 2010 22:33
Also... Why not just boot from a CD/DVD and install per normal. It is pretty straight forward that way to install. 10.04 might not solve the three problems mentioned, but neither does the post above.
September 07, 2010 22:56
All of those are valid and reasonable solutions. This post exists for one reason: If you google around you'll find hundreds of people who (for whatever reason) can't use those solutions. They have VPC and that's what they've got. This post explains how to solve THAT problem.

Personally, I run Ubuntu in VirtualBox.
September 07, 2010 22:59
Still not sure why you wouldn't pop the disk in and do a straight install. Following the prompts gets you to the same spot as above, no special steps required with sudo, GUIDs etc. etc.
September 07, 2010 23:28
Have you tried this with 10.04? It's changed a LOT, video, audio, etc. It just doesn't work with VPC.
September 08, 2010 4:36
Yes, Virtual PC 2007 boots of a disk and installs without any of the extra steps you go through above.

You can up the resolution after that. Yes it is a pain for that one task, which isn't covered above.

But the extra drive mounting and permission changing seems overly complicated. Unless this is some kind of remove desktop to a VM where you don't have physical access.

Why not just pop in a disk and boot off the Ubuntu install disk? Boom. Done.
September 08, 2010 7:12
I appreciate what you're saying and I'd love for it to be simpler. Have you tried this yourself with 10.04? It just doesn't work when I try it here.
September 08, 2010 23:45
As happy as I was that they updated VP I still prefer VirtualBox, it just works.

I am thinking of just installing Ubuntu and running Windows 7 in a virtual machine, but I need Windows for Gaming!
September 13, 2010 5:07
Great guide! I'm sure thousands of us are thankful you took the time to write this up.
September 13, 2010 12:32
10000 Thank you Scott !
September 21, 2010 2:50
I just walked through this process with 10.04, and it worked just fine. I used the ISO for 10.04.1 if that matters, and used the 32 bit version (even though I am running on 64bit Win7).

Good luck!
B>
September 23, 2010 6:20
Solution how to fix the Mouse Problem:

Replace "quiet splash" to "VGA=788 i8042.noloop" in GRUB config and upgrade.

Worked for me. Greetz :)
September 24, 2010 23:45
I used a faster way to make fix permanent:

-I executed Terminal
-cd /
-sudo nano /etc/default/grub
-I replaced 'quiet splash' with 'vga=791'

It worked for me. Is it shorter?
September 29, 2010 17:17
Help! I tried the instructions step-by-step, but after I type " vga=791 noreplace-paravirt", and hit ENTER, I get the following:

BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) mount: mounting /dev/loop2 on //filesystem.squashfs failed: Input/output error
Can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs

What do I do????
RCN
September 29, 2010 17:58
Ok, update to my previous post. It apparently doesn't like my ISO image, nor CD/DVD drive. I copied it to a USB stick and went from there....
RCN
October 03, 2010 12:13
I reached to the point where I was to reboot the VM, but I only saw the Casper message for about half a second before I got an error like this

[ 3103.1######] end_request: I/O error, dev sr0, sector 521###

can anyone help me please.
October 13, 2010 22:17
Thanks for the tutorial. A few months ago I spent a lot of time trying to get Ubuntu 10.4 to work with Virtual PC on Vista with absoluetly no luck and a lot of cussing. It's now working, Yay! OK so second attempt and a few bits were a little fiddly but I'm really not bothered about that now.

And for those of you who never had a problem - why are you writing on a website telling other people yours worked and questioning the tutorial? Lucky you, but your experience and situation is not necessarily the same as everybody elses. And can I have some of your free time please? (minor rant over)

I looked through most of the comments and couldn't see any Vista specifics but the main differences/points I found were...

1) To set up a fixed disk create the virtual machine, then before running it in the settings for that machine...

* select the Hard Disk 1
* start the Virtual Disk Wizard
* create a new fixed disk of an appropriate size somewhere sensible
* wait for it to create the disk
* then change the file for Hard Disk 1 to the file which the wizard just created

2) I'm working on a laptop over wireless and in the settings set Networking to the WiFi adaptor

3) The ISO file to install from is set after the Virtual Machine has been started in the menu CD->Capture ISO Image...

4) It's the Right Alt Key to get your mouse back

5) In the restart at the end its really important to hit enter to get it to stop fully

Thanks again!

Gavin
November 10, 2010 19:21
Very good it's post. I'am have a big problem for used it's solutions...
Thanks!!!
December 11, 2010 11:57
Thanks. Work like a charm.
December 13, 2010 8:48
Thank you!!! Excellent info that allowed me to get Ubuntu up and running using Win 7 x64 / Virtual PC. I think I need a beer.
December 14, 2010 0:42
Scott, great entry! You've saved me tons of time and made me quickly productive with what I was trying to do.

Allow me to "give back" and offer up an error reducing step. Above where it states "get emotionally ready" to type in the GUID, you can copy that GUID into the clipboard by:
1) Right-clicking a whitespace between the folders of the drive.
2) From the "GUID Properties" pop-up window, click on the GUID value in the Name: field.
3) Press Control-a to select all the characters.
4) Press Control-c to copy the GUID into your clipboard.

Thanks again!
December 30, 2010 19:27
Scott,

First let me say thank you for this blog. I have been struggling to load Ubuntu 10.10 into VPC with little to no success until reading this blog. The thing that stuck with me is that there had to be something that I was missing... it shouldn't be this hard. What I found is that when my VPC was booting I could hit 'Delete' and get into the bios for the VPC. Once in the bios for the VPC I could change the boot order and set the CD Drive to have the boot priority. Once I did this I used MagicDisc to mount the ISO on my host computer and then set that virtual CD to be the CD Drive for the VPC in the settings. Once I did this I was able to install Ubuntu regular from the ISO without having to burn a disc, create an usb bootable drive or anything else. So it seems that having VPC use the ISO directly as the CD was part of the issue for me. I still have the issue of the VPC reverting back to 800x600 and I have ran into another issue of not being able to allocate more than 1 GB of ram but my install of Ubuntu is running and is stable. As to the video reverting back to 800x600 that is because Ubuntu is viewing the monitor as standard VGA, so I just have to remember/find how to add additional resolutions since VPC does not allow Ubuntu direct access to the hardware to make a determination and that should resolve the monitor issue.

~Larry
February 08, 2011 16:41
I solved the graphics resolution issue, at least to some extent. I created a new "xorg.conf" file in /etc/X11/ setting the appropriate "Screen", "Monitor" and "Device" settings, most importantly the bit-depth to 16 and the resolutions to "1280x1024" "1162x768" "1024x768" "800x600", and Ubuntu starts everytime in 1280x1024. I wanted widescreen (I am using a laptop) so 1024 pixels vertical meant I got scrollbars which I prefer not to have in the guest-OS window, so I removed 1280x1024 and it now boots as 1162x768. What I would really like is to find out how I can set any arbitrary resolution here (fx. 1832x1003). This may need a different X-driver (or whatever it is called, I am a total Linux newbie) supporting the desired resolutions. The information how to create the "xorg.conf" file is abundant on the internet, just google it. My current "xorg.conf" file can be downloaded here: https://sugarsoft.com/Files/Downloads/ubuntu.xorg.conf.zip. Using this xorg.conf file it boots my Ubuntu 10.04 in 1162x768 without problems, however it always crashes when I shut down (who cares /shrug). At least now I can test-play a little bit of Linux. Thanks Scott for a very helpful blog.
February 14, 2011 3:16
Have tried this twice with no success. Probably my fault, perhaps even the gudi error. But as it is tedious perhaps someone could give me advice.

Using win7 pro.
Virtual PC of about 1.5 gig mem, 10 gig disk

Do all the steps, at update-grub final lines are:
.......
found memtest86+ image: /boot/memtest86+bin
cannot find list of partitions!

last seem serious.

And indeed when I try to reboot I am screwed.

russ
February 18, 2011 22:06
So no help from you guys, but I did get help from a friend.
First more about my environment toshiba portable i7 64 bit os.
Found you could get into bios by holding delete and then change boot order so can reboot from iso image when
the hard drive boot fails.

Then holding shift during hard drive boot will let you into grub.

None of the above is a fix, apparently a new kernel is a help. My friend Noah says:

I chroot'd into the machine:

sudo mount -o bind /dev /media/THATGUID/dev
sudo chroot /media/THATGUID/ /bin/bash
mount -t proc none /proc


I then installed the kernel from
http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-natty/

and rebooted.
February 19, 2011 4:12
Russ - Thanks for sharing your update!

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.