$ egrep "(vmx|svm)" /proc/cpuinfo |
$ lsmod | grep kvm |
$ qemu-kvm
-vnc |
$ qemu-kvm -display none |
$ qemu-kvm -monitor stdio -display none |
(qemu) info
kvm ... (qemu) info status ... (qemu) stop (qemu) info status ... (qemu) quit |
$ qemu-kvm -chardev socket,id=tcpmon0,port=5000,host=localhost,server,nowait -monitor chardev=tcpmon0 & |
$ nc
localhost (qemu) quit |
$ cp /vms/vm.img disk-vm.img |
$ qemu-kvm -m
128 \ -drive file=disk-vm.img \ -serial stdio \ -display none |
passord: cubswin:) $ free -m $ sudo poweroff |
$ sudo ip tuntap add yourlogin-tap0 mode tap |
$ sudo ip link set yourlogin-tap0 up |
$ sudo ip addr add 192.168.10.1/24 dev yourlogin-tap0 |
$ ifconfig yourlogin-tap0 |
$
cp /vms/vm.img . |
$
qemu-kvm -m 128 -drive file=vm.img \ -netdev type=tap,ifname=yourlogin-tap0,id=net0,script=no \ -device virtio-net-pci,netdev=net0,mac=aa:00:00:11:76:f0 \ -serial stdio -display none |
user:
cirros password: cubswin:) |
$
sudo ip link set eth0 up $ sudo ip addr add 192.168.10.2/24 dev eth0 |
$ ping -c 5 192.168.10.1 |
$
sudo ip tuntap add yourlogin-vm1-tap mode tap $ sudo ip tuntap add yourlogin-vm2-tap mode tap |
$
sudo ip link set yourlogin-vm1-tap up $ sudo ip link set yourlogin-vm2-tap up |
$
sudo brctl addbr yourlogin-br0 $ sudo brctl addif yourlogin-br0 yourlogin-vm1-tap $ sudo brctl addif yourlogin-br0 yourlogin-vm2-tap |
$ sudo ip link set yourlogin-br0 up |
$ sudo brctl show |
$
cp /vms/vm.img vm1.img $ qemu-kvm -m 128 -drive file=vm1.img \ -netdev type=tap,ifname=yourlogin-vm1-tap,id=net0,script=no \ -device virtio-net-pci,netdev=net0,mac=aa:00:00:11:76:f1 \ -serial stdio -display none |
$
cp /vms/vm.img vm2.img $ qemu-kvm -m 128 -drive file=vm2.img \ -netdev type=tap,ifname=yourlogin-vm2-tap,id=net0,script=no \ -device virtio-net-pci,netdev=net0,mac=aa:00:00:11:76:f2 \ -serial stdio -display none |
user:
cirros password: cubswin:) $ sudo ip link set eth0 up $ sudo ip addr add 10.2.3.1/24 dev eth0 |
user:
cirros password: cubswin:) $ sudo ip link set eth0 up $ sudo ip addr add 10.2.3.2/24 dev eth0 |
$ ping -c 5 10.2.3.2 |