02 Jun 2009 @ 9:42 AM 

This will hopefully tell you how to install virtual box in ubuntu, and have it use your existing windows partition. Of course, no one wants to reinstall all their stuff in the “virtual drive”. This is my first time using a virtual machine. This is based off the tutorials at http://ubuntuforums.org/showthread.php?t=769883 but that didnt work for me so this is what i did to make it work on my machine. A lot of it is the same.

Create a grub boot cd
First you might want to create a boot cd as a easy way to boot your partitions. This first line just takes your current config and moves it to your home directory so you can edit it then turn it into a iso.

cd ; mkdir -p iso/boot/grub ; cp /usr/lib/grub/*-pc/stage2_eltorito /boot/grub/menu.lst iso/boot/grub
 
<strong>Edit the menu.lst in our soon to come boot cd</strong>

at this point we want to edit this file so we can make it ONLY boot our windows partition. If you boot the partition your on in a virtual machine its horrible i’ve heard so we dont want it to default to our ubuntu partition or something.

 gedit ~/iso/boot/grub/menu.lst

Now go to the part where it has all the ubutnu or other os’s options and delete all that, most of the entries look like this. Only leave the last one which is your windows partition.

title		Ubuntu 8.10, kernel 2.6.27-11-generic
uuid		6bb9b9cc-0bc9-4b1f-af2e-bb675a993b65
kernel		/boot/vmlinuz-2.6.27-11-generic root=UUID=6bb9b9cc-0bc9-4b1f-af2e-bb675a993b65 ro xforcevesa quiet splash vga=791
initrd		/boot/initrd.img-2.6.27-11-generic
quiet

Then on your windows partition modify it to look similar to this, the main thing i did was changed “root” to “rootnoverify”

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Windows XP Professional x64 Edition
rootnoverify		(hd0,0)
# savedefault !! comment this out
makeactive
chainloader	+1

Make the boot CD iso

Now save and close that gedit window. Then make the grub stuff we were just messing with into a bootable iso.

cd ; mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
 
<strong>Make sure you have latest version of VirtualBox</strong>

At this point i totally removed my old version of virtual box using package manager, then i installed the new version from virtualbox.org using their easy package installer thing. You need the version 2.1+ to get support for 64bit os’s. I installed version 2.2 … so this tutorial is working for that version.

After i installed i didnt see it anywhere so i went to a terminal and typed “VirtualBox” to start it … yes the case matters.

Add your user to disk and vboxusers

In order for you to run the command we need to run next your user must be part of a group that is allowed to do this so we type this.

sudo usermod -a -G disk
sudo usermod -a -G vboxusers
 
<strong>Setup our passthrough virtual drive</strong>

then run this command to make our weird passthrough thing that links to our real physical partition.

VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/WinHD.vmdk -rawdisk /dev/sda -partitions 1 -relative -register

Please note the “/dev/sda -partitions 1″ specifies partition one of my first sata disk… change this to your windows partition.

Create different profile for windows MUST DO !!

Ok now you must also at this point boot into windows and create another “profile” to boot into when you boot from linux. If not your hardware profile will get messed up when you boot into it from linux and you will not be able to use windows by itself anymore. So go into windows, right click my computer -> properties -> Hardware -> hardware profiles ->copy. Then name your second one to something you want, and make sure the timer is like 30 seconds so you can choose.

Create and run new virtual machine

Ok now boot back into linux, open a terminal type “VirtualBox” create a new virtual machine as type windows, use the drive we made and tell it to also mount a iso, use the iso we made.

The first time i tried it it said “error 15 file not found” … which i had been getting a lot of, dont fret just type “c” to get a command then type

grub: rootnoverify (hd0,0)
grub: makeactive
grub: chainloader +1
grub: boot

I cant because i dont have hardware virtualization in my cpu but you might
Then windows tries to start but cant because it still thinks its running on a 32 bit machine … lets go look in the virtual box settings for our virtual machine.

Ok, this story does not have a happy ending. Turns out my processor E4400 does not support VT or whatever it is. Its called hardware virtualiziation, and you need it to run a 64 bit guest OS. So even if i was in windows 7 using this feature to run Win XP 64 it would not work. Sorry everyone. You should note that everything else worked its just that windows 64 bit was unable to start due to the above problem.

Here is a list of cpu’s and if they have hardware virtualization

Tutorial on how to do this #1

Tutorial on how to do this #2

Posted By: admin
Last Edit: 02 Jun 2009 @ 09:42 AM

EmailPermalinkComments (0)
Tags
Change Theme...
  • Users » 5
  • Posts/Pages » 71
  • Comments » 62
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Contact Me



    No Child Pages.

Front



    No Child Pages.