Install the Windows2003 system in the Xen virtual machine full virtualization environment

  • 2020-05-17 07:12:06
  • OfStack

The Xen virtual machine supports both client installations. One is paravirtualization and one is full virtualization. The Win2003 system requires installation and operation in a fully virtualized environment.

Hardware environment: DELLR710 CPU must support virtualization technology (available for cat /proc/cpuinfo |grep vmx), BIOS enables VT full virtualization function. System environment: physical machine centos5.6 x86_64,xen. Virtual machine windows2003 to install

1. Physical machine preparation environment:

1. xen installation

yum install xen kernel-xen

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

default=0, change the value to 0, use title CentOS (2.6.18-238.el5xen) kernel boot, default is title CentOS (2.6.18-194.el5) kernel boot, can view xen through uname, r.

3. xen service is enabled

/etc/init.d/xend start
/etc/init.d/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
Check if the virtual machine bridge is up or not
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 the virtual machine

The virtual machine is installed on a logical volume, the partition of which is based on the following sequence

Physical partitions > Physical volume > The volume group > The logical volume

fdisk /dev/sda builds the remaining volume into a primary partition
partprobe synchronize partitions to the system
pvcreate /dev/sda4 create physics
vgcreate vg01 /dev/sda4 establish the group name vg01
lvcreate-L 90G-n sphone_win vg01 create logic sphone_win

Group and logic view 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 of the deployed virtual machine:

There are two ways to do this: 1 by creating a script to install it via virt-install, and 1 by writing a good virtual machine configuration file (more convenient, as shown below).

1. Install vnc, vnc-server (with the system)

yum list vnc vnc-server

2. xend configuration file changes /etc/xen/ xend-config.sxp

(vnc-listen '115.238.x.x ') uncomment and change the local IP, vnc, IP when the client is connected
(vncpasswd '123456') sets the vnc password
/etc/init.d/xend restart

3. Create a profile to install the virtual machine in /etc/xen

[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/zw86sp2a.iso,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" starts from the first disk, in this case the optical drive
localtime=1 takes physical machine time for virtual machine time
disk win virtual machine iso files can be placed in the physical machine local /tmp directory.
vif bridge binds the first nic eth0 out
vnc=1 turns on vnc remote control
vncconsole=1 vnc is turned on by default when turned on
vpcpasswd is the vnc session password

4. Start the virtual machine

#xm create /etc/xen/ spone_web
#ps, ef |, grep vnc view the 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
View virtual machine number ID
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.238 x. x: 23 can start next windows graphical interface is installed


Related articles: