Remote Installation of kvm virtual machines, kvm virtual machines

Source: Internet
Author: User

Remote Installation of kvm virtual machines, kvm virtual machines

The following environment is used, and the test passes:

Virsh version:

Compiled against library: libvirt 1.1.1

Using library: libvirt 1.1.1

Using API: QEMU 1.1.1

Running hypervisor: QEMU 1.5.3

OS version:

Red Hat Enterprise Linux Server release 7.1 (Maipo)



Network composition:
PC ---> server (10.167.14.102) ----> server (192.168.10.3)

You need to install linux on KVM on the server through a PC. The PC cannot directly access the server. You need to ssh to the stepping server and then ssh to the server.


The procedure is as follows:

1. Create a hard disk image:

Qemu-img create-f qcow2/var/lib/libvirt/images/test. qcow2 20G


2. After preparing the OS image file on the server, run the following command:

2. 1. Install the SDK through the command line:

# Virt-install -- virt-type kvm -- name = test -- ram = 4096 -- vcpus = 2 -- OS-type = linux \

-- Location =/root/rhel-server-7.0-x86_64-dvd.iso \

-- Disk/var/lib/libvirt/images/test. qcow2, format = qcow2 \

-- Network bridge: brx \

-- Graphics none -- extra-args = 'console = tty0 console = ttyS0, 115200n8 serial'

All settings are completed through the command line.


2. Remote vnc installation:

# Virt-install -- virt-type kvm -- name = test -- ram = 1024 -- vcpus = 1 -- OS-type = linux \

-- Location =/root/rhel-server-7.0-x86_64-dvd.iso \

-- Disk/var/lib/libvirt/images/test. qcow2, format = qcow2 \

-- Network bridge: brx \

-- Graphics vnc, password = 123456


2.2.1. display the vnc port used

# Virsh vncdisplay test

127.0.0.1: 0

It is displayed as 0. This is not the traditional port. The actual port is 5900 + 0 = 5900.


2.2.2. Use teraterm ssh to 10.167.14.102, and then set the relay:

Local port 12345

Remote Host: Port 192.168.10.3: 5900


2.2.3. Use vnc viewer on a PC:

Address: localhost: 12345

Password: nfvpoc

(If the image is flashed back, remove adapt to network speed from option-> display, and then lower the image quality)


* It is also mentioned on the Internet
/Etc/libvirt/qemu. conf
In
# Vnc_listen = "0.0.0.0"
If it is not unlocked, The vnc port cannot be released externally. I have not met this port. If the above description is not successful, try it, but do not forget

Systemctl restart libvirtd to make it take effect.

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.