HOW TO RUN VIRTUAL WINDOWS XP'S PC IN YOUR SOLARIS DESKTOP WITH QEMU:
Download Qemu and Kqemu from opensolaris.org
http://www.opensolaris.org/os/project/qemu/downloads/
Note:
kqemu now supported down to Solaris 8/X86
Compile kernel kqemu
kqemu is a kernel accelerator doc is
available at: http://fabrice.bellard.free.fr/qemu/kqemu-doc.html
-
Enter in kqemu src directory
# cd
kqemu-1.3.0pre11__osol20070214
- Run make
#
cp Makefile.opensolaris_i386 Makefile
# make
gmake -C common
all
gmake[1]: Entering directory
`/home/jblanche/qemu/kqemu-1.3.0pre11__osol20070214/common'
gmake[2]:
Entering directory
`/home/jblanche/qemu/kqemu-1.3.0pre11__osol20070214/common'
/usr/sfw/bin/gcc
-Wall -O2 -Werror -g -D__KERNEL__ -I.. -o genoffsets
genoffsets.c
./genoffsets > monitor_def.h
/usr/sfw/bin/gcc
-D__KERNEL__ -iwithprefix include -I. -I.. -D__ASSEMBLY__ -c -o
i386/nexus_asm.o i386/nexus_asm.S
/usr/sfw/bin/gcc -D__KERNEL__
-iwithprefix include -I. -I.. -D__ASSEMBLY__ -c -o i386/monitor_asm.o
i386/monitor_asm.S
/usr/sfw/bin/gcc -Wall -O2 -fomit-frame-pointer
-fno-strict-aliasing -Werror
-D__KERNEL__ -iwithprefix include -I. -I.. -c -o monitor.o
mon
itor.c
/usr/sfw/bin/gcc -Wall -O2 -fomit-frame-pointer
-fno-strict-aliasing -Werror
-D__KERNEL__ -iwithprefix include -I. -I.. -c -o monitor-utils
.o
monitor-utils.c
/usr/sfw/bin/gcc -Wall -O2 -fomit-frame-pointer
-fno-strict-aliasing -Werror
-D__KERNEL__ -iwithprefix include -I. -I.. -c -o interp.o
inte
rp.c
/usr/sfw/bin/gld -T i386/monitor.ld -o
monitor-image.out i386/nexus_asm.o i386/monitor_asm.o monitor.o
monitor-utils.o interp.o
gobjcopy -O binary monitor-image.out
monitor-image.bin
/usr/sfw/bin/gcc -Wall -O2 -Werror -g -o genmon
genmon.c
./genmon < monitor-image.bin >
monitor-image.h
/usr/sfw/bin/gcc -Wall -O2 -fomit-frame-pointer
-fno-strict-aliasing -Werror -D__KERNEL__ -iwithprefix include
-I. -I.. -c -o kernel.o kernel.c
/usr/sfw/bin/gcc -D__KERNEL__
-iwithprefix include -I. -I.. -D__ASSEMBLY__ -c -o i386/kernel_asm.o
i386/kernel_asm.S
/usr/sfw/bin/gld -r -o ../kqemu-mod-i386.o
kernel.o i386/kernel_asm.o
gmake[2]: Leaving directory
`/home/jblanche/qemu/kqemu-1.3.0pre11__osol20070214/common'
gmake[1]:
Leaving directory
`/home/jblanche/qemu/kqemu-1.3.0pre11__osol20070214/common'
/usr/sfw/bin/gcc
-D_KERNEL -g -o kqemu-solaris-i386.o32 -c
kqemu-solaris-i386.c
/usr/sfw/bin/gld -r -o kqemu-solaris-i386
kqemu-solaris-i386.o32 kqemu-mod-i386.o
- Run make
install
# make install
cp kqemu-solaris-i386
kqemu
/usr/sbin/install -f /usr/kernel/drv -m 755 -u root -g sys
kqemu
new owner is root
kqemu installed as
/usr/kernel/drv/kqemu
rm kqemu
/usr/sbin/install -f
/usr/kernel/drv -m 644 -u root -g sys kqemu.conf
new owner is
root
kqemu.conf installed as /usr/kernel/drv/kqemu.conf
rm -f
/dev/kqemu
add_drv kqemu
( cd /dev ; /usr/sbin/mknod kqemu c
`/usr/bin/grep kqemu /etc/name_to_major | /usr/bin/awk '{print $2}'`
0 )
- Check that kqemu is load into the kernel
#
modinfo |grep kqemu
238 f977a000 19ec8 211 1
kqemu (kqemu accelerator v0.2)
WARNING: If you wish to
run qemu as non-root user then check rights of /dev/kqemu
Install qemu package from opensolaris.org
# pkgadd -d
./SUNWqemu-0.8.2_cvs20070120_REV_2007.01.24-sol10-i386-opt.pkg
The
following packages are available:
1 SUNWqemu
qemu
(i386) 0.8.2__cvs20070120sat
Select package(s) you wish to
process (or 'all' to process
all packages). (default: all)
[?,??,q]: all
...
...
Create a disk image file with qemu
# /opt/SUNWqemu/bin/qemu-img create /var/qemu/disk1.img
4GB
Formating '/var/qemu/disk1.img', fmt=raw, size=4194304 kB
#
chown jblanche /var/qemu/disk1.img
Start Qemu and Install Windows XP
- Insert your Windows XP's DVD/CD SP2
WARNING:
Used CD With Windows XP SP2 or the installation will failed.
-
Start Quemu and boot on cdrom
[18]
id
uid=18557(jblanche) gid=18557(jblanche)
[19]
/opt/SUNWqemu/bin/qemu -m 512 -k fr -boot d -hda /var/qemu/disk1.img
-cdrom /dev/dsk/c1t0d0s2
My cdrom is located on
/dev/dsk/c1t0d0s2 my TOSHIBA M3 LabTop
- Follow
Microsft Windows XP Install Program
Wait....a long long long time...
Windows XP will reboot and
will Finish the installation
Start Windows XP after Windows Installation with Network user
By default QEMU used the user mode network stack
(http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC30)
you don't need root priviledge to use the virtual network.
The
QEMU VM behaves as if it was behind a firewall which blocks all
incoming connections. The DHCP server assign addresses to the hosts
starting from 10.0.2.15.
The Firewall address is 10.0.2.2 (Which
is your Solaris hosts).
So you can simply communicate with
Solaris using the 10.0.2.2 network address in Your Virtual Window's
XP PC. See next example (telnet to solaris from Windows XP)
#
/opt/SUNWqemu/bin/qemu -m 512 -k fr -boot c -hda /var/qemu/disk1.img
How to share DATA between Solaris (host OS) and your Virtual Windows XP's PC (Guest OS)
You can start QEMU with -smb
(http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC10)
option to share data with SMB.
When using the user mode
network stack, activate a built-in SMB server so that Windows OSes
can access to the host files in `dir' transparently. In the guest
Windows OS, the line: 10.0.2.4 smbserver
Then `dir' can be
accessed in `\\10.0.2.4\qemu'. Note that a SAMBA server must be
installed on the host OS see following example:
qemu -m 512 -k fr -hda /var/qemu/disk1.img -smb /var/qemu/SMB
How To Use Internet In you Virtual Windows XP's PC (Guest OS)
With QEMU in user mode network stack there is nothing to do. Every ouput traffic from you Virtual Windows XP's PC (Guest OS) is send to the default router (10.0.2.2) and then QEMU will NAT all network traffic to the ouput Solaris Network Interface.