[Solved] Dual-boot AND Guest?
-
TheJimtasticOne
- Posts: 9
- Joined: 31. Jul 2008, 19:36
[Solved] Dual-boot AND Guest?
My current setup is dual-booting linux and windows. I want to migrate/install windows into a guest, so I can use windows programs without rebooting, but I've also heard about games using 3d acceleration etc. not working.
Obviously I can't have two XP installations without two licenses (which I'm NOT going to do) but I was wondering whether it would be possible (and legal) to have windows boot from a partition on my hard disk as a normal OS, or boot Linux as a normal OS and then XP as a guest from within Linux depending on what I wanted to do. Is this possible (and if so how), or are there other ways round it?
Obviously I can't have two XP installations without two licenses (which I'm NOT going to do) but I was wondering whether it would be possible (and legal) to have windows boot from a partition on my hard disk as a normal OS, or boot Linux as a normal OS and then XP as a guest from within Linux depending on what I wanted to do. Is this possible (and if so how), or are there other ways round it?
Last edited by TheJimtasticOne on 15. Sep 2008, 21:35, edited 1 time in total.
-
william.dowling
- Posts: 7
- Joined: 31. Jul 2008, 22:49
re-using dual boot existing partition
This is *exactly* my question. I have searched a little and http://www.virtualbox.org/wiki/Migrate_Windows seems relevant. I just can't suck enough meaning out of it though to see how to do this.
Will
Will
-
william.dowling
- Posts: 7
- Joined: 31. Jul 2008, 22:49
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
Yes it is fully doable, Im' using this every day. A part of what needs to be done is described in the virtualbox users' guide at the chapter talking about advanced disk management - you need to create a .vdmk container which describes the access to your partitions. I've made a small guide for this, but it is partly english/french (as I was writing it "live"). I can do the translation if you want to.
One important thing : you have to create another windows hardware profile in you "native" windows otherwise you will mess it up when you'll boot it as a virtual machine (rememeber that the hardware seen by Windows in this case is not your real one)
Tell me if you need help
One important thing : you have to create another windows hardware profile in you "native" windows otherwise you will mess it up when you'll boot it as a virtual machine (rememeber that the hardware seen by Windows in this case is not your real one)
Tell me if you need help
-
william.dowling
- Posts: 7
- Joined: 31. Jul 2008, 22:49
-
TerryE
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
You need to browse the Windows forums for guidance on profiles. You will find the path to them under My Computer -> Properties -> Harware -> Hardware Profiles. They were mainly introduced for Laptop users who used docking stations, because active docking stations have a PCI bus extender, extra peripherals such as LAN card, maybe an extra HDD, keyboard, mouse and display.
The profile tells windows what to expect the hardware that its running on looks like, and when booting the kernel checks the H/W and automatically selects the best profile, so by copying the current profile and reconfiguring it to match the Vbox virtual machine, you don't screw up the bare metal configuration. Instead, you give Windows two choices of machine configuration to choose from: one that look like bare metal and one which looks like the VBox VM. As long as you set up the DMI info correctly, you should avoid having to reactivate Windows every time that you swap.
The profile tells windows what to expect the hardware that its running on looks like, and when booting the kernel checks the H/W and automatically selects the best profile, so by copying the current profile and reconfiguring it to match the Vbox virtual machine, you don't screw up the bare metal configuration. Instead, you give Windows two choices of machine configuration to choose from: one that look like bare metal and one which looks like the VBox VM. As long as you set up the DMI info correctly, you should avoid having to reactivate Windows every time that you swap.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
[img]- Create another hardware profile in windows (under "hardware" of "system properties") - I recommend, although optional that you boot this profile natively and remove at least the native video driver as it might create problems while booting the windows in the VM. BTW, using no timeout in chosing hardware profile at boot time is better to avoid silly mistakes of booting the wrong profile ...
- Next, create a .vdmk container in Linux, so boot your Linux host and
- I recommend you don't use the whole disk access, but only the partitions you really need (see fdisk /dev/[your partition] to list them)
- I also recommend to use another IPL, not the original disk boot loader otherwise it will ask you if you want to boot Linux or Windows when you boot your VM, which is obviously stupid. For this, use any IPL (you can extract it yourself using (eg) MBRFix - if you have problems, tell me and I'll send you one, this is a tiny file). With this trick, you will directly boot your windows partition in the VM and will be asked for the hardware profile you want
- So, to create the .vdmk container : VBoxManage internalcommands createrawvmdk -filename [/path/to/file.vmdk] -rawdisk /dev/[your device eg :sda] -partitions [your windows partition(s) eg 1,5] -mbr winxp.mbr
- Don't forget to have the current user member of the group "disk" otherwise the above mentionned command will not work
- In your virtualbox, choose IO APIC, otherwise your windows will not be happy when booting as I assume it has previously started with IO APIC.
- Finally, I experienced problems with my virtualmachine using a lot of CPU (50%) running windows guest, even while idle. To solve this, I had to
force (in hardware device manager) the "computer" device properties to be "ACPI only", not the default on (sorry, can't remember the exact english translation, tell me if this is not clear)
All this works like a charm and rock solid and I can boot my very same windows either within a Linux host, or natively to benefit DirectX etc
- Next, create a .vdmk container in Linux, so boot your Linux host and
- I recommend you don't use the whole disk access, but only the partitions you really need (see fdisk /dev/[your partition] to list them)
- I also recommend to use another IPL, not the original disk boot loader otherwise it will ask you if you want to boot Linux or Windows when you boot your VM, which is obviously stupid. For this, use any IPL (you can extract it yourself using (eg) MBRFix - if you have problems, tell me and I'll send you one, this is a tiny file). With this trick, you will directly boot your windows partition in the VM and will be asked for the hardware profile you want
- So, to create the .vdmk container : VBoxManage internalcommands createrawvmdk -filename [/path/to/file.vmdk] -rawdisk /dev/[your device eg :sda] -partitions [your windows partition(s) eg 1,5] -mbr winxp.mbr
- Don't forget to have the current user member of the group "disk" otherwise the above mentionned command will not work
- In your virtualbox, choose IO APIC, otherwise your windows will not be happy when booting as I assume it has previously started with IO APIC.
- Finally, I experienced problems with my virtualmachine using a lot of CPU (50%) running windows guest, even while idle. To solve this, I had to
force (in hardware device manager) the "computer" device properties to be "ACPI only", not the default on (sorry, can't remember the exact english translation, tell me if this is not clear)
All this works like a charm and rock solid and I can boot my very same windows either within a Linux host, or natively to benefit DirectX etc
-
william.dowling
- Posts: 7
- Joined: 31. Jul 2008, 22:49
Thanks Philippe -- this is great! I used this command
to build the mbr file. I also had to run the MergeIDE program referred to in the tutorial page. Then I got a boot-up!
Little thing I am stuck with now is that the mouse capture is not working, as though the guest isnot or cannot read the mouse device. Searching in the forum, I see there are several other folks with this problem. It may be a usb thing, for which some work-arounds have been reported. Thanks again,
Will D
Code: Select all
/sbin/install-mbr --force /home/wdowling/winxp.mbr -register
Little thing I am stuck with now is that the mouse capture is not working, as though the guest isnot or cannot read the mouse device. Searching in the forum, I see there are several other folks with this problem. It may be a usb thing, for which some work-arounds have been reported. Thanks again,
Will D
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
Hi - good to hear it (almost) worked. I use a PS/2 mouse so I do not have a problem. Did you install all the USB support in virtualbox ? It is pretty hairy. I've not tried it myself, but here is what I have from my notes gathered some time ago
- add to /etc/fstab : none /proc/bus/usb usbfs devgid=46,devmode=664 0 0
- add a group : usbusers
- edit /etc/udev/rules.d/40-permissions.rules and add the group usbusers in between the SUBSYSTEM code and GOTO.
# USB Serial Converters
SUBSYSTEM==”usb_device”, GROUP=”usbusers”, GOTO=”usb_serial_start”
- Edit /etc/init.d/mountdevsubfs.sh and uncomment these 4 lines
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs“”/dev/bus/usb/.usbfs=obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb
- it sounds odd to me, especially the last mount in the script as obviously it it unconsistent with what is in fstab. I'll give it a try later - if you try and are successful, let me know
- add to /etc/fstab : none /proc/bus/usb usbfs devgid=46,devmode=664 0 0
- add a group : usbusers
- edit /etc/udev/rules.d/40-permissions.rules and add the group usbusers in between the SUBSYSTEM code and GOTO.
# USB Serial Converters
SUBSYSTEM==”usb_device”, GROUP=”usbusers”, GOTO=”usb_serial_start”
- Edit /etc/init.d/mountdevsubfs.sh and uncomment these 4 lines
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs“”/dev/bus/usb/.usbfs=obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb
- it sounds odd to me, especially the last mount in the script as obviously it it unconsistent with what is in fstab. I'll give it a try later - if you try and are successful, let me know
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
ok - just tried now, plugging a USB mouse on my linux box. This worked for me, even without uncommenting the lines in mountdevusbfs.sh. Of course, I did not mention, but when creating the group "usbusers", you need to have the user running virtualbox to be member of this group ...
Silly question, but I guess you installed the virtualbox additions ?
Silly question, but I guess you installed the virtualbox additions ?
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
Did a little bit more tests : I can confirm that with host Kubuntu 8.0.4-1 , Virtualbox 1.6.4, and guest Window XP SP3, you only need to mount /proc/bus/usb through fstab the following way to have access to USB peripherals in the guest :
none /proc/bus/usb usbfs devgid=<vboxusers gid>,devmode=664 0 0
of course, assuming you have put the current VB user in the group "vboxusers". I did not create another "usbusers" like some says neither did I change any scripts and rules. I'm sure it works too, but I alway like to do the very bare modifications and to make sure they are _really_ needed
none /proc/bus/usb usbfs devgid=<vboxusers gid>,devmode=664 0 0
of course, assuming you have put the current VB user in the group "vboxusers". I did not create another "usbusers" like some says neither did I change any scripts and rules. I'm sure it works too, but I alway like to do the very bare modifications and to make sure they are _really_ needed
-
TheJimtasticOne
- Posts: 9
- Joined: 31. Jul 2008, 19:36
Thanks, I tried your suggestions: when I boot into xp normally everything is fine, but when booting in the vm it gets to the xp splash screen, the blue progress bar starts moving for a while, then I get a blue screen for about 0.4 seconds, then it restarts. Does anyone know why?
EDIT: Here's a screenshot:

EDIT: Here's a screenshot:

-
philippe44
- Posts: 45
- Joined: 31. Jul 2008, 20:56
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Kubuntu, misc Linux, XP
Did you enable IO APIC in the VM configuration (VirtualBox machine general seetings) ? If you have multi-core CPU with VT/-V support, did you try NOT to enable it in VB ?
If the above did not work, then did you boot the virtualbox hardware profile, but as a native windows boot (not under VB), then remove hardware-specific drivers (graphic board, motherboard items like VIA drivers etc ...), then tried to boot it under VB ?
After all this, you can try to boot under VB with a Windows CD and then re-install the HAL kernel (choose install, repair) - of course only do this as the last attempt as it will force you to re-install all hardware-specific drivers and all windows updates even on your native windows boot - but if your problem is driver-specific, this is the way to go, I did that numerous times, for other reasons (upgrading my motherboard)
Let me know if it helps
If the above did not work, then did you boot the virtualbox hardware profile, but as a native windows boot (not under VB), then remove hardware-specific drivers (graphic board, motherboard items like VIA drivers etc ...), then tried to boot it under VB ?
After all this, you can try to boot under VB with a Windows CD and then re-install the HAL kernel (choose install, repair) - of course only do this as the last attempt as it will force you to re-install all hardware-specific drivers and all windows updates even on your native windows boot - but if your problem is driver-specific, this is the way to go, I did that numerous times, for other reasons (upgrading my motherboard)
Let me know if it helps
-
TheJimtasticOne
- Posts: 9
- Joined: 31. Jul 2008, 19:36
Thanks for your reply.
I had enabled IO APIC before I booted it in virtualbox, and also I hadn't enabled hardware virtualisation (AMD-V). I have a dual-core AMD Athlon, does virtual box let the guest see both cores? Because otherwise it might be wondering why sometimes it's got two to play around with and sometimes only one.
I did do the hardware profile thing and I disabled my graphics card driver, but I'll have another look now and disable anything else I can find.
I had enabled IO APIC before I booted it in virtualbox, and also I hadn't enabled hardware virtualisation (AMD-V). I have a dual-core AMD Athlon, does virtual box let the guest see both cores? Because otherwise it might be wondering why sometimes it's got two to play around with and sometimes only one.
I did do the hardware profile thing and I disabled my graphics card driver, but I'll have another look now and disable anything else I can find.