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.