Get the App
SLTechnology News&Howtos  ›  Servers  › 

Installation method of Xen Virtual Machine under Ubuntu system

Shulou Source: shulou.com Published: 2022-06-01 15:32:59 11月16日 Update

This article mainly explains "the installation method of the Xen virtual machine under the Ubuntu system". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the installation method of the Xen virtual machine under the Ubuntu system".

Install a virtual machine on Xen on Ubuntu

Method one

Dd an empty disk

The code is as follows:

Sudo dd if=/dev/zero of=/home/vm1.img bs=1G count=8

Download the Xen VM generic configuration file

The code is as follows:

Sudo wget http://mirrors.aliyun.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/xen/xm-debian.cfg\

-O / etc/xen/vm1.conf

Modify the downloaded configuration file accordingly

The code is as follows:

Memory = 256

Name = "vm1"

Disk = ['tap2:tapdisk:aio:/home/vm1/vm1.img,xvda1,w']

Execute installation command

The code is as follows:

Sudo xm create-f / etc/xen/vm1.conf-c install=true\

Install-kernel= "http://mirrors.aliyun.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/xen/vmlinuz"\"

Install-ramdisk= "http://mirrors.aliyun.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/xen/initrd.gz"\"

Install-mirror= "http://mirrors.aliyun.com/ubuntu"

Method two

Dd an empty disk

The code is as follows:

Sudo dd if=/dev/zero of=/home/vm1.img bs=1G count=8

Format disk

The code is as follows:

Sudo dd if=/dev/zero of=/home/vm1.img bs=1G count=8

Mount disk

The code is as follows:

Sudo mkdir / mnt/vm1

Sudo mount-o loop / home/vm1.img / mnt/vm1

Using Domain0's file system to create DomainU's file system

The code is as follows:

#! / bin/bash

Cat > / tmp/exclude.list

Tags: Code methods systems files disks learning configuration content support variables commands that is ideas situations articles more formats versions knowledge knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information vpn MySQL Docker