Remotely perform a KVM virtual machine installation

Source: Internet
Author: User

Using the following environment, measured by:

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---> Console server (10.167.14.102)----> server (192.168.10.3)

A Linux system installation is required on the KVM on the server via the PC. The PC does not have direct access to the server, SSH to the stepping server, and then SSH to the server.


The steps are as follows:

1. Create a new 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, execute the following command:

2.1. Direct command line installation:

#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 done through the command line.


2.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. Displaying the VNC port used

# Virsh Vncdisplay Test

127.0.0.1:0

Shown as 0, this is not what we say in the traditional sense of the port, the actual port should be 5900+0=5900.


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

Local Port: 12345

Remote host: 192.168.10.3 Port: 5900


2.2.3. Using the VNC Viewer on your PC:

Address: localhost:12345

Password: NFVPOC

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


* Some people are talking on the Internet
/etc/libvirt/qemu.conf
In the
#vnc_listen = "0.0.0.0"
Do not unlock the words can not release VNC port, I do not encounter, if the use of the above instructions are unsuccessful, you may try, but do not forget

Systemctl Restart LIBVIRTD make it effective.

Remotely perform a KVM virtual machine installation

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.