SoFunction
Updated on 2025-04-09

Detailed Guide to XenServer Installation and Virtual Machine Deployment

1 Understand server configuration

1.1 Check whether the server CPU supports virtualization

1.1.1 Purpose

Currently, mainstream CPUs produced by Inter and AMD support virtualization technology, but many computers or motherboard BIOS are disabled by default when leaving the factory.

1.1.2 Method

setp1: After restarting the server, press F2 or F10 to enter the BIOS interface (the keys required to enter the BIOS for different motherboard models)
setp2: Switch the BIOS display to the Process panel. Since the motherboard is different, the display keywords in the BIOS are different. The main thing is to find Virtual or Virtualization to set it to Enabled
setp3: Save modified CPU virtualization settings when exiting BIOS

1.2 Check the server memory size
1.2.1 Purpose

In order to reasonably allocate memory size to virtual machines deployed on virtualization platforms, let’s first understand the server’s memory configuration.

1.2.1 Method
setp1: Execute the command: free -m
setp2: View the displayed results, as shown in this example total: 65501, which means that the server has 64G memory

1.3 View server CPU information
1.3.1 Purpose
In order to reasonably allocate the number of CPUs and cores to virtual machines deployed on the virtualization platform;

1.3.1 Method
setp1: Execute the command: cat /proc/cpuinfo |grep "physical" |sort|uniq -c
setp2: View the displayed results, as shown in this example, a total of 24 cores (two 12 core CPUs)

1.4 View server hard disk information
1.4.1 Purpose

In order to reasonably allocate the virtual hard disk size to virtual machines deployed on the virtualization platform;

1.4.1 Method
setp1: Execute the command: df -Th
setp2: View the displayed results, as in this example, it shows 48T

2 Related software and mirror downloads

2.1 XenServer installation image download
2.1.1 Download Purpose
The image files required for installing XenServer
2.1.2 Download address
/overview-xenserver-open-source-virtualization/
Version 2.1.3
XenServer-6.2.
2.1.4 Burning
Burn the XenServer-6.2. mirror file to the disc.
2.2 Download XenCenter installation package
2.2.1 Download Purpose
XenServer's client software is installed on a Windows machine that can connect to the XenServer server network.
2.2.2 Download address
/download/hvfdh/8270781
Version 2.2.3
citrix xencenter 6.5

3 XenServer installation

After preparing for so long, I can finally install it! ! !
3.1 Installation steps
Basically, if you continue to ok, you need to pay attention to the following points:
setp1: Start the server from the CD
setp2: Pay attention to the details such as US keyboard type selection, Shanghai area selection, etc.
setp3: Pay attention to the selection of VirtualMachine Storage. Generally, according to the default, no optimization mode is selected.
setp4: Pay attention to network and DNS settings, and use local actual network settings
setp5: Note that during general installation, do not select to install patches
3.2 Install XenCenter

XenCenter is the management client of XenServer, which can be used to manage XenServer and the virtual machines deployed on it;
XenCenter is installed on a Windows machine that can be connected to the network with XenServer; the installation steps are simple and will not be described here;
After the XenCenter installation is completed, you can connect to the XenServer server through the "Add Server" operation.
3.3 Virtual machine deployment preparation

Installing XenServer is relatively simple, but it is a little trouble to deploy virtual machines on XenServer. It is just that unlike other virtualization platforms, XenServer separates the virtual machine installation image from other storage, so it is a little troublesome. However, if you are careful, you will find so easy, haha, let's get started!
3.3.1 Purpose of creating a new lv volume

☻ During the installation of XenServer, there is no disk partition operation like the usual installation system;
☺ After the installation of the XenServer system is completed, check the disk information. The result is to take the following installation as an example: the hard disk has a total of 48T, but after the df -Th command, it is found that there is only 4G hard disk space, and the system files of XenServer have occupied 1.9G;
☻Then the problem is, if you want to deploy a virtual machine on XenServer, the storage will not be enough, and there will be about 2G of available storage space left, and basically you cannot put a CentOS system image. How can you break this?
☺ Haha, XenServer has the concept of storage repository. Storage repository (SR - Storage Repositories) is used to store ISO or VDI.
☻ The original intention of XenServer is to use shared storage, which can support three storage types: FC SAN, ISCSI SAN, and NFS.
☺ To be able to store virtual images, you need to first create an lv volume on the XenServer server to store ISO images; then create a storage warehouse for XenServer, specifically for storing virtual machine installation images, and mount the newly created lv volumes on the storage warehouse;
3.3.2 Steps to create a new lv volume
setp1: View remaining space
Execute the command: vgdisplay; it can be seen that the VG Size is 40TB, and the Name number of the existing lv partition is VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8

setp2: View details of this area
Execute the command: lvdisplay VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8
setp3: Create a new 20G LV volume iso to store virtual image files
Execute the command: lvcreate -L 20GB -n iso VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8
Show Logical volume "iso" created
setp4: Check the area again
Execute the command: lvdisplay VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8
It can be seen that the newly created iso logical volume has been displayed, with a size of 20GB.
setp5: Format the logical volume just created to ext3 format
Execute the command: mkfs.ext3 /dev/VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8/iso
setp6: Create an iso file in the root directory for mounting the ISO image file
Execute the command: mkdir /iso
And transfer the virtual machine installation image to the /iso directory through Xshell
setp7: Activate all volume groups
Execute the command: vgchange -a y
Show 2 logical volume(s) in volume group "VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8" now active
setp8: Mount/iso folder
Execute the command: mount /dev/VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8/iso /iso
setp9: Add automatic mount in /etc/fstab
Execute the command: vi /etc/fstab
Added: /dev/VG_XenStorage-a9c7a79c-4277-2805-4d34-3bae47a473f8/iso /iso ext3 defaults 0 0
setp10: Create SR in XenCenter
Execute the command: xe sr-create name-label=iso_storage type=iso device-config:location=/iso device-config:legacy_mode=true content-type=iso
Show 6bab3651-e2ce-c490-a00a-e2858ee2dfa3
setp11: Execute xe-toolstack-restart
At this time, you can see the newly created SR iso_storage in the properties directory of XenCenter; switch to the storage directory of iso_storage, and you can see the list of virtual machine image files uploaded to the /iso directory in step 6.
☺☺At this point, the preparations for virtual machine deployment are completed, and then the virtual machine is installed;

3.4 Virtual Machine Deployment

Deployment of virtual machines on XenServer can be quickly deployed through the virtual machine deployment template provided on XenCenter

* Virtual machine installation steps*

setp1: Select the template for the corresponding version of the virtual machine you want to install in XenCenter
As in this example, install: CentOS 6.5 64bit

setp2: Select the virtual machine image path

Select the corresponding CentOS image file under iso_storage created earlier
setp3: Configure the CPU, memory and other information of the virtual machine
setp4: Check the virtual machine configuration information, and after confirming that it is correct, you can install the virtual machine;
setp5: After the virtual machine is installed, install xenserver-tools. The purpose of installing xenserver-tools is to easily view the performance curve information of the virtual machine in XenCenter;
Execute the command: mount /dev/xvdd /mnt/
Execute the command: /mnt/Linux/
setp6: configure the network and other information of the newly created virtual machine

☺☺At this point, the deployment of the CentOS virtual machine has been completed, and the deployment steps of the Windows virtual machine are simpler and more convenient. I will not repeat them here

Problems that may be encountered during operation and solutions

Question 1: After restarting XenServer, I found that I can't find the SR Iso_storage I created before.

Iso_storage and lv volume iso failed to mount, just remount

Problem 2: Reasons for Linux virtual machine to enable graphical interface

When installing Linux on XenServer (CentOS is used here), there is no graphical interface installation. After searching for information, it is found that it is a compatibility issue for XenServer: since the template that comes with XenServer was selected when creating a virtual machine, you can just select Other Media in the operating system template when creating a virtual machine.

Question 3: The virtual machine cannot start inexplicably
The possible reason is that when creating a virtual machine, you can use Fast copy mode and Full copy mode.