Search:  
Gentoo Wiki

HOWTO_Configure_a_dual_boot_windows_linux_to_be_able_to_open_each_os_in_vmware


Contents

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.

(2) Linux becomes virtual

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

Create the virtual machine that will host your Linux

Boot into windows and run VMware workstation.

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

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

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.

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:


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 :)

(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.

Preparing Windows

Boot with windows.

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.

Create the virtual machine that will host your Windows

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


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.

In case of troubles

If you get a BSOD with error STOP 0x0000007B (INACCESSIBLE_BOOT_DEVICE), then there are chances that you did not disable the hardware-specific hard disk driver; you might want to read this MS support article. Next you will have to run this regedit file on the Windows XP guest.

Related Pages

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Configure_a_dual_boot_windows_linux_to_be_able_to_open_each_os_in_vmware"

Last modified: Sat, 23 Aug 2008 12:08:00 +0000 Hits: 18,709