The entire process of installing Windows virtual machines under xen

Source: Internet
Author: User

+ Response -------------------------------------------------------------------------------------------------------------------------------
Attention: befor taking the following steps, make sure you have followed the xen-install.txt to install xen & VNC parts correctly.
+ Response -------------------------------------------------------------------------------------------------------------------------------
1. Create a virtual machine path
Is where your VM files are stored in the host.
[Root @ server201/] # mkdir/opt/xen/kcwin2k3_2
[Root @ server201/] # cd/opt/xen/kcwin2k3_2
My habit is to create a virtual machine under/opt/xen/xxxx.

2. Create a Windows Virtual Machine
[Root @ server201 kcwin2k3_2] # virt-install-N kcwin2k3_2 -- file = disk1.img -- file = disk2.img -- VNC-v-C/ISO/win2k3. iso-r 512 -- vcpus = 1
How large wowould you like the disk (disk1.img) to be (in gigabytes )? 8
How large wowould you like the disk (disk2.img) to be (in gigabytes )? 1
Here we use the virt-install command to install the virtual machine. I will explain the parameters here.
--------------------------------------------------------------------
Virt-install command for Virtual Machine Creation
-N vm name
-- File: the disk file of the VM.
-- VNC connection using VNC Terminal
-R vm memory capacity
-- Number of vcpus Virtual Machine CPUs
-V Visualization
-C path for image Installation
 
The following message is displayed:
Starting install...
Unable to connect to graphical console; 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.
The installation has actually started, but since the text terminal does not support images, you are expected to connect to the graphics terminal through port 5900, and the installation of this virtual machine has not been terminated.
The problem is that the VM has been initialized. The task is to install the system of the VM. You can shut down the Virtual Machine and start the system later. We have a lot to do here.
 
 
3. modify the configuration file of this virtual machine
[Root @ server201 kcwin2k3_2] # cd/etc/xen/
[Root @ server201 xen] # ls
Auto kcwin2k3_2 xend-config.sxp xmexample1 xmexample. VTI
Kcentos 5 qemu-IFUP xend-pci-permissive.sxp xmexample2
Kcwin2k3 scripts xend-pci-quirks.sxp xmexample. hvm
(Do you remember that after a virtual machine is created, there will be a configuration file with the same name in its configuration file path. We need to modify it. These yellow files are the configuration files of the virtual machines I have installed. Currently, this article is referring to the Virtual Machine kcwin2k3_2, it can be seen from the name that this is the second windows virtual machine I have installed)
[Root @ server201 xen] # vi kcwin2k3_2 (now let's edit this configuration file)
-------------------- This is the configuration file generated by the application in the original version ----------------------
# 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'

Bytes ------------------------------------------------------------------------------------------------------------------
However, this is not enough. We need to make more modifications to it. As for what each item is used for, we will explain the following. The configuration file I modified is as follows:
Bytes ------------------------------------------------------------------------------------------------------------------
# Automatically generated xen Config File
Import OS, re
Arch = OS. uname () [4]
If Re. Search ('64', arch ):
Arch_libdir = 'lib64'
Else:
Arch_libdir = 'lib'
(If you want to use the xen Virtual Machine to install windows, add the above section. We can see that this virtual machine is created through the hvm mode. The specific parameter descriptions of the hvm mode virtual machine are also explained in detail, that is, the hvm template help file, it is in the xen configuration path. The default file name is/etc/xen/xmexample. hvm)
Name = "kcwin2k3_2" (Virtual Machine name)
Builder = "hvm" (Virtual Machine in hvm Mode)
Memory = "512" (memory is 512 MB, in MB)
Disk = ['file:/opt/xen/kcwin2k3_2/disk1.img, hda, W', (Do you still remember the parameter -- file = when creating a VM? This is the first virtual disk of the VM)
'File:/opt/xen/kcwin2k3_2/disk2.img, HDB, W)
'File:/ISO/win2k3. ISO, HDC: CDROM, R, then r indicates 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 explains it as... skipping... Khan)
Vnclisten = "0.0.0.0" (this is the NIC address opened by VNC, which is not limited here)
Vncdisplay = 1 (VNC shows that this is also added later)
# APIC = 1
# ACPI = 1
APIC = 0)
ACPI = 0 (same as APCI, which must be set to 0 here. The default value is also 1. The default values of the first two rows are commented out by me)
PAE = 1
Boot = "DC" (here is the starting sequence of virtual machines. D indicates from CDROM, C indicates from local disk, and a indicates from floppy disk. From left to right. After installing the system, we recommend that you change it to "C" and start it only from the hard disk)
Vcpus = 1 (number of Virtual Machine CPUs)
Serial = "Pty" # enable serial console
On_reboot = 'restart'
On_crash = 'restart'
Bytes ------------------------------------------------------------------------------------
Now, the configuration file of this virtual machine is modified. The above content marked with a green flag is added later. Please refer to/etc/xen/xmexample. the hvm template file provides a detailed description of hvm.

 
8. Restart the VM.
[Root @ server201 xen] # XM create kcwin2k3_2
Using Config File "./kcwin2k3_2 ".
Error: VM name 'kcwin2k3 _ 2' already in use by domain 1
This indicates that the kcwin2k3_2 machine has been started. I want it to shut down and restart.
[Root @ server201 xen] # XM destroy kcwin2k3_2
Remember to use the XM destroy name or XM destroy id command instead of the XM shutdown command to completely shut down the VM.
[Root @ server201 xen] # XM create kcwin2k3_2
Using Config File "./kcwin2k3_2 ".
Started domain kcwin2k3_2 (if this prompt is displayed, the startup is successful)
 
Next, you can use the VNC client to connect to the host for installation at the remote end. We recommend that you use the RealVNC Client instead of The UltraVNC client. If I try it out, it will be a big screen. In addition, it is recommended that you use the mouse to install windows in VNC.

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.