Install the Windows virtual machine full process under Xen

Source: Internet
Author: User
Tags uuid

+-------------------------------------------------------------------------------------------------------------- -----------------
Attention:befor taking the following steps, make sure your have followed the xen-install.txt to install Xen & VNC part s correctly.
+-------------------------------------------------------------------------------------------------------------- -----------------
1. Establish Virtual machine path
is the place where your virtual machine files are stored in the host, first to be established
[root@server201/]# Mkdir/opt/xen/kcwin2k3_2
[root@server201/]# Cd/opt/xen/kcwin2k3_2
It's my custom to build virtual machines under/OPT/XEN/XXXX.

2. Establish Windows2003 virtual machine
[root@server201 kcwin2k3_2]# virt-install-n kcwin2k3_2--file=disk1.img--file=disk2.img--vnc-v-c/iso/win2k3.iso-r 5 --vcpus=1
How large would your like the disk (disk1.img) to IS (in gigabytes)? 8
How large would your like the disk (disk2.img) to IS (in gigabytes)? 1
Here is the use of the Virt-install command to install the virtual machine, the parameters of which I'll explain
--------------------------------------------------------------------
Virt-install the command to establish a virtual machine
-N Naming of virtual machines
--file disk files for virtual machines
--vnc using VNC terminal connection mode
-R virtual Machine memory capacity
Number of CPUs--vcpus virtual machines
-V Visual
-C Installation Image path

The following prompt message appears:
Starting install ...
Unable to connect to graphical console;  The DISPLAY is not set. Please connect to localhost:5900
Domain installation still in progress. You can reconnect to the console to complete the installation process.
This is actually starting to install, but because the text terminal does not support the image, so I want users to connect to the graphics terminal through 5900 ports, and the installation of this virtual machine does not terminate, still continue.
The problem is, here, the virtual machine has been initialized to form, and the current job is just to install the virtual machine's system. You can shut down this virtual machine first, and then start to continue installing the system, we still have a lot of work to do here.


3. Modify the configuration file for this virtual machine
[root@server201 kcwin2k3_2]# cd/etc/xen/
[root@server201 xen]# ls
Auto Kcwin2k3_2 xend-config.sxp xmexample1 xmexample.vti
Kcentos5 qemu-ifup xend-pci-permissive.sxp Xmexample2
KCWIN2K3 Scripts Xend-pci-quirks.sxp XMEXAMPLE.HVM
(remember here before that when you set up a virtual machine, there is a configuration file with the same name in its configuration document path, and we want to modify it.) These yellow files are the configuration files for the virtual machines I installed, and this is the kcwin2k3_2 virtual machine, which is the name of the second Windows virtual machine I've installed.
[root@server201 xen]# VI kcwin2k3_2 (now we're going to edit this configuration file)
----------------------This is the original configuration file generated by the application----------------------
# automatically generated Xen config file
Name = "Kcwin2k3_2"
Builder = "HVM"
Memory = "512"
disk = [' File:/opt/xen/kcwin2k3_2/disk1.img,hda,w ',
' File:/opt/xen/kcwin2k3_2/disk2.img,hdb,w ',]
Vif = [' Type=ioemu, mac=00:16:3e:3f:74:8f, Bridge=xenbr0 ',]
UUID = "fb0f5b19-30b7-b349-ceaf-2d4332ebf65d"
Device_model = "/USR/LIB/XEN/BIN/QEMU-DM"
Kernel = "/usr/lib/xen/boot/hvmloader"
Vnc=1
Vncunused=1
Apic=1
Acpi=1
Pae=1
Vcpus=1
Serial = "Pty" # Enable serial console
On_reboot = ' Restart '
On_crash = ' Restart '

--------------------------------------------------------------------------------------------------------------- ---
But this is not enough, we need to make more changes to it, as for each item is what to do with, then will explain, now I modified the configuration file as follows
--------------------------------------------------------------------------------------------------------------- ---
# automatically generated Xen config file
Import OS, re
Arch = Os.uname () [4]
If Re.search (' ', Arch '):
Arch_libdir = ' lib64 '
Else
Arch_libdir = ' lib '
(If you want to install Windows systems with Xen virtual machines, this section is added.) We can see that this virtual machine is built by HVM, the description of the specific parameters of the HVM mode virtual machine also has a very detailed explanation, is HVM template Help file, it is in the Xen configuration path, the filename defaults to/ETC/XEN/XMEXAMPLE.HVM)
Name = "Kcwin2k3_2" (name of the virtual machine)
Builder = "HVM" (Virtual machine for HVM mode)
Memory = "512" (Memory is 512M, this unit is MB)
disk = [' File:/opt/xen/kcwin2k3_2/disk1.img,hda,w ', (remember the parameter--file= when you set up the virtual machine?) This is the first virtual disk of the virtual machine.
' File:/opt/xen/kcwin2k3_2/disk2.img,hdb,w ', (this is the virtual machine's second virtual disk, writable, and virtual HDB location)
' File:/iso/win2k3.iso,hdc:cdrom,r ',] (this one is added later, specifies the CDROM of the virtual machine, the target is actually a WIN2K3 installation of the ISO mirror on the host, then R is read-only)
Vif = [' Type=ioemu, mac=00:16:3e:3f:74:8f, Bridge=xenbr0 ',] (this is the virtual network interface of the virtual machine)
UUID = "fb0f5b19-30b7-b349-ceaf-2d4332ebf65d"
Device_model = "/USR/LIB/XEN/BIN/QEMU-DM"
Kernel = "/usr/lib/xen/boot/hvmloader"
Vnc=1 (VNC enabled)
Vncunused=1 (this manual is interpreted as ... skipping ...). Sweat
Vnclisten= "0.0.0.0" (This is also later added, VNC open network card address, which means no restrictions)
Vncdisplay=1 (VNC shows, this is also added later)
#apic =1
#acpi =1
Apic=0 (APIC is cheap, this is set to 0, the default is 1, it will be installed Windows will always be stuck in a screen)
Acpi=0 (same APCI, here also want to set to 0, default is also 1. You can see the default values for the first two lines are commented out by me.
Pae=1
Boot= "DC" (here is the boot order of the virtual machines, d means from the cdrom,c representation from the local disk, a represents the floppy disk.) From left to right, it is recommended that after installing the system, it will be changed to "C" and only boot from the hard disk.
Vcpus=1 (number of virtual machine CPUs)
Serial = "Pty" # Enable serial console
on_reboot= ' Restart '
On_crash= ' Restart '
------------------------------------------------------------------------------------
Here is a change of the virtual machine configuration file, the above with the Green Grass logo content is added, please refer to/etc/xen/xmexample.hvm This template file, there is a very detailed description of the HVM virtual machine.


8. Restart the virtual machine
[root@server201 xen]# XM Create Kcwin2k3_2
Using config file "./kcwin2k3_2".
ERROR:VM name ' Kcwin2k3_2 ' already in use by domain 1
This is to say that this kcwin2k3_2 machine has been started, and I am now shutting it down to reboot
[root@server201 xen]# XM Destroy Kcwin2k3_2
Remember, when you shut down the virtual machine completely, use the XM destroy name or the XM destroy ID command, not the XM shutdown.
[root@server201 xen]# XM Create Kcwin2k3_2
Using config file "./kcwin2k3_2".
Started domain Kcwin2k3_2 (This prompt indicates successful startup)

The next step is to install the host on the remote client connection using VNC, and it was suggested that the RealVNC client connection be used instead of the UltraVNC. I try really true, with ultravnc words, will be very flower screen. Another point to suggest is that when you install Windows under VNC, it is very unpleasant to use the mouse, please get used to the keyboard.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.