SoFunction
Updated on 2025-04-14

Install Windows 2003 system in Xen virtual machine full virtualization environment

Xen virtual machine supports two client installation methods. One is paravirtualization and the other is full virtualization. Win2003 system requires installation and operation in a fully virtualized environment.

Hardware environment: DELL R710 The CPU must support virtualization technology (can be viewed by cat /proc/cpuinfo |grep vmx), and the BIOS enables the full virtualization function of VT. . System environment: physical machine centos5.6 x86_64, xen. The virtual machine to be installed windows2003

1. Physical machine preparation environment:

1. xen installation

yum install xen kernel-xen

2. Edit grub, use the xen kernel to start /etc/

default=0   Change the value to 0 and start with the title CentOS (2.6.18-238.el5xen) kernel. The default is title CentOS (2.6.18-194.el5) kernel. You can view the xen kernel through uname –r.

3. The xen service is enabled

/etc//xend start
/etc//xendomains start

4. Load the xen bridge file

#vi /etc/xen/scripts/test-network-bridge 500 file permissions
#!/bin/sh 
dir=$(dirname "$0") 
"$dir/network-bridge" "$@" vifnum=0 netdev=eth0 bridge=xenbr0
"$dir/network-bridge" "$@" vifnum=1 netdev=eth1 bridge=xenbr1
"$dir/network-bridge" "$@" vifnum=2 netdev=eth2 bridge=xenbr2
"$dir/network-bridge" "$@" vifnum=3 netdev=eth3 bridge=xenbr3
#ifconfig    Check if the virtual machine bridge is up
xenbr0    Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF  
          UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 
          RX packets:1172736 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0  
          RX bytes:76745681 (73.1 MiB) TX bytes:0 (0.0 b) 

5. Prepare disk space for virtual machines

The virtual machine is installed on a logical volume, and the division of the logical volume is established based on the following order.

Physical Partition>Physical Volume>Volume Group>Logical Volume

fdisk /dev/sda
Partprobe
pvcreate /dev/sda4 creates physics
vgcreate vg01 /dev/sda4   Create group name vg01
lvcreate -L 90G -n phone_win vg01 Create logical phone_win

Group and logic viewing results: vgdisplay lvdisplay

--- Logical volume --- 
LV Name                /dev/vg01/sphone_win 
VG Name                vg01 
LV UUID                53xsbO-pyXW-qXa0-xCq2-QcdS-RRt2-w0hFh0 
LV Write Access        read/write 
LV Status              available 
# open                 2 
LV Size                90.00 GB 
Current LE             23040 
Segments               1 
Allocation             inherit 
Read ahead sectors     auto 
- currently set to     256 
Block device           253:0  

2. Installation preparation for deploying virtual machines:

Two ways: one is installed through virt-install through creation scripts, and the other is installed by writing virtual machine configuration files (more convenient, the following is this).

1.   Install vnc, vnc-server (with its own system)

yum list vnc vnc-server

2.    xend configuration file change /etc/xen/

(vnc-listen '115.') Remove the comments and change the external IP of the machine. The IP when the vnc client is connected
(vncpasswd '123456')     Set vnc password
/etc//xend restart

3. Create a configuration file to install the virtual machine in the /etc/xen directory

[root@SN708 ~]# vi /etc/xen/spone_web
name = "sphone_win"
maxmem = 2048
memory = 2048
vcpus = 2
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
pae = 1
acpi = 1
apic = 1
localtime = 1
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
disk = [ "phy:/dev/vg01/sphone_win,hda,w", "file:/tmp/,hdc:cdrom,r" ] 
vif = [ "mac=00:16:3e:a0:00:4b,bridge=xenbr0,script=vif-bridge" ] 
boot = "c"
parallel = "none"
serial = "pty"
vnc=1
vncconsole=1
vpcpasswd='123456' 
 

Parameter description:
boot="c"   Start from the first disk, here is the optical drive
localtime=1      Make the time of the virtual machine using the physical machine time
disk
vif                                                                                                                              �
vnc=1 enable vnc remote control
vncconsole=1 VNC is enabled by default when booting
vpcpasswd is the vnc session password

4. Turn on the virtual machine

#xm create /etc/xen/ spone_web
#ps –ef |grep vnc   View process
root     19937 5052 0 Dec19 ?        00:12:56 /usr/lib64/xen/bin/qemu-dm -d 23 -m 2048 -boot c -localtime -serial pty -vcpus 2 -acpi -domain-name sphone_win -net nic,vlan=1,macaddr=00:16:3e:a0:00:4b,model=rtl8139 -net tap,vlan=1,bridge=xenbr0 -vnc 115.238.31.172:23,password -vncunused -vncviewer 
root     19945 19937 0 Dec19 ?        00:00:00 [vncviewer] <defunct>
root     25714 25669 0 11:12 pts/2    00:00:00 grep vnc
# xm li to view the virtual machine ID number
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0    21998    16 r----- 11857.1
sphone_win                                23     2055     2 -b---- 85099.3

5.   VNC client tool connection

vnc viewer connection IP: ID number, such as 115.:23, you can start installing the windows graphical interface.

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.