HOWTO Configure a dual boot windows linux to be able to open each os in vmware

From Gentoo Linux Wiki

Jump to: navigation, search


Contents

[edit] Introduction

VMware workstation is a commercial product that permit you to emulate a complete virtual computer and to run an operating system of your choice on it.

This tutorial will describe how to achieve the following goals:

  1. dual-boot of Windows XP or Gentoo
  2. Gentoo as Host (real OS) and Windows XP as Guest (emulated OS)
  3. Windows XP as Host (real OS) and Gentoo as Guest (emulated OS)

Before continuing, be sure that (1) is already possible in your current system. If you are looking for case (2), then you might want to read also Install Gentoo on VMware article.

Your system can boot natively with Windows or with Linux, but you can't use both in the same time. After reading this tutorial you will be able to run your Linux or Windows XP (installed in real disk partitions) inside VMWare virtual machines.

You will need vmware-player and vmware-modules on Gentoo to run the Windows XP virtual machine (although having Workstation helps during the wizard for the VM creation).

If you need the VMWare tools on the Windows XP VM, read HOWTO_Get_VMWare_Tools.

[edit] (2) Linux becomes virtual

Gentoo Linux supports multiple harware configurations at the same time. Read HOWTO Install Gentoo on VMware for more informations.

[edit] Create the virtual machine that will host your Linux

Boot into windows and run VMware workstation.

  • Menu File -> New -> Virtual Machine
  • Virtual Machine Configuration : Custom
  • Virtual Machine Format : (both are ok)
  • Guest Operating System : Linux, Version : (choose yours, for Gentoo, I use Other Linux 2.6.x kernel)
  • Name : (as you want), Location : (as you want)
  • Number of processors (as you want)
  • Memory : (let a big amount for windows if you don't want horrible swapping)
  • Network connection : (as you want)
  • I/O adapter type : (as you want, but be careful about your kernel support. I chose BusLogic for my Gentoo)
  • Disk : Use a physical disk
  • Device : (choose the disk you boot on, internal or external) and Use entire disk
  • Disk file : (as you want)

Note: If you receive an "Unable to complete wizard: insufficient permission to access file" error, exit the vmware console, and do the following steps:

chmod g+rw /dev/sdX* #Where sdX is the disk Windows is installed on.

You will also need to have your user in the 'disk' group:

gpasswd -a USERNAME disk

[edit] Boot your Linux into the virtual machine

Don't start x for the moment, as the xorg.conf file must be adapted. Normally, you should not have any problem if you correctly configured the support for all the virtual hardware that VMware emulates. Backup your xorg.conf file

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.real

Generate a new xorg.conf file

Xorg -configure

Try this new xorg.conf file

X -config /root/xorg.conf.new

This configuration should work into vmware. If this is the case, copy this file

cp /root/xorg.conf.new /etc/X11/xorg.conf.virtual

Now you have three solutions

  • The lazy one : each time you switch from real mode to virtual mode, you have to copy the corresponding xorg.conf.real/xorg.conf.real as xorg.conf
  • The nice one : take a text editor and merge the two xorg.conf.xxxx files into one big. Rename the devices names so they will be explicit, and write two layouts.
  • Do a new start level (see below)

This is a suggested xorg.conf

Edit: If you didn't set the GUI in /etc/rc.conf already, now is the right time to do it. Edit your /etc/rc.conf and put the right value for XSESSION variable:

XSESSION="Gnome"  # for Gnome environment

or

XSESSION="kde-3.5" # for KDE 3.5.X environment 

With this kind of xorg.conf file, when you start in real mode, just

startx

and when you start in virtual mode, type

startx -- -layout virtual

(virtual is the layout name you can see here above in the configuration file)

That's it :-) You can now boot your Linux in both modes.

[edit] Doing a new start level

First two ways is good, if you are useing only startx script to start a X server. But what should you do if you are using a xdm script, which is starting with whole system?

First, you need to create a new start level:

 cp -r /etc/runlevels/default /etc/runlevels/vmware

then modify a new vmware level by rc-update, as you want. Remember to add a vmware-tools to it!

Now edit your grub/lilo config by adding softlevel=vmware. i know how to do it in grub, and somone please post here how to do it in lilo!!

File: /boot/grub/grub.conf

title=Gentoo Linux (VMware)

kernel /vmlinuz.vm root /dev/ram0 real_root /dev/evms/gentoo doevms udev softlevel=vmware

initrd /initrd

ok new start level is ready, now we must do something with xorg.conf . I've done a special two scripts, which copying a xorg.conf.1 or xorg.conf.vm to xorg.conf at start, before xdm, so you need to create two files:

  • xorg.conf.1 for real config
  • xorg.conf.vm for vmware config.


File: /etc/init.d/X

#!/sbin/runscript

depend() {

before xdm

}

start() {

ebegin "Copying xorg.conf.1 to xorg.conf"

cp /etc/X11/xorg.conf.1 /etc/X11/xorg.conf

eend $?

}

stop() {

ebegin "Copying xorg.conf to xorg.conf.1"

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.1

eend $?

}


File: /etc/init.d/X-VMware

#!/sbin/runscript

depend() {

before xdm

}

start() {

ebegin "Copying xorg.conf.vm to xorg.conf"

cp /etc/X11/xorg.conf.vm /etc/X11/xorg.conf

eend $?

}

stop() {

ebegin "Copying xorg.conf to xorg.conf.vm"

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.vm

eend $?

}

Now add it

 rc-update add X default
 rc-update add X-VMware vmware

that's it, X should start normaly.

Somone please check my english, correct it and remove this clause, i think i do some mistakes :)

[edit] (3) Windows XP becomes virtual

Note: As Windows will boot into the virtual machine it will recognize that hardware has changed and then you could have some license problems. But don't complain, it's necessary to get the best from your genuine software.

[edit] Preparing Windows

Boot with windows.

  • Go to the System Properties (Control Panel -> System, or right click on My Computer -> Properties)
  • Click on "Hardware", then on the "Hardware Profiles..." button
  • It is a good idea to rename the current one to "Real" for instance
  • Click on the "Copy" Button and name the second "VMWare"
  • Click the "Wait until I choose a profile" radio button
  • Click all the "OK" buttons you find
  • Restart the computer with Windows and choose the hardware profile you just created.
  • Go to the system properties (Configuration Panel -> System, or right click on My Computer -> Properties)
  • Click on "Hardware", then on the "Device Manager" button
  • Unfold the IDE ATA/ATAPI IDE Controllers
  • Right-Click on "Intel(R) 82801DBM Ultra ATA Storage Controller" and click on "Update Driver..."
  • Choose "Install from a list... (advanced)"
  • Choose "Don't search, I will choose..."
  • Click on the "Standard Dual Channel PCI IDE Controller"
  • Next -> Finish

Restart Windows in real mode to be sure that this IDE controller is working fine (normally it should). After that, you can shutdown Windows and restart with Linux.

[edit] Create the virtual machine that will host your Windows

Boot into Gentoo Linux and run VMware workstation or VMware player.


  • Menu File -> New -> Virtual Machine
  • Virtual Machine Configuration : Custom
  • Virtual Machine Format : (both are ok)
  • Guest Operating System : Windows, Version : (choose yours)
  • Name : (as you want), Location : (as you want)
  • Number of processors (as you want)
  • Memory : (as you want)
  • Network connection : (as you want)
  • I/O adapter type : (as you want)
  • Disk : Use a physical disk
  • Device : (choose the disk you boot on, internal or external) and Use entire disk
  • Disk file : (as you want)

[edit] Boot your Windows into the virtual machine

Just let it boot, be careful to choose the correct hardware profile, because Windows will start installing, removing, updating several hardware drivers ! When Windows is booted, don't let it installing some stuff before you launch the VMware tools installation in VMware menu. When you will do it, it will insert a virtual cdrom into your Windows, launch this cdrom and all the drivers of the virtual hardware will be installed, especially great mouse and graphics performances improvements. You will have to reboot, and after the reboot, set the correct screen resolution because by default the new virtual display driver is set to 640x480.

[edit] In case of troubles

If you get a BSOD with error STOP 0x0000007B (INACCESSIBLE_BOOT_DEVICE), then you might want to read this MS support article.

In a few words, you will have to run this regedit file on the Windows XP guest.

[edit] Related Pages

Personal tools