1

A colleague of a friend of mine established a voluntary project for a gaming union. But the problem now is, that the person is unavailable and I don´t know how I should access the running VMs. I spent days in searching through the internet to find the solution.

Now I know that the VMs are running under libvirt with qemu and kvm. It´s possible for me to start or to shutdown the VMs through the virsh command (which was also new for me).

ps ax | grep qemu

shows me the following:

16767 pts/0    S+     0:00 grep --color=auto qemu
18250 ?        Sl   388:50 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1000 -smp 4,sockets=4,cores=1,threads=1 -name Teamspeak1 -uuid a973dbb4-04e1-942b-1546-615f425b931b -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Teamspeak1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/Teamspeak1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:29:5f:61,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
18295 ?        Sl    79:15 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1024 -smp 8,sockets=8,cores=1,threads=1 -name Webserver -uuid 14b56603-7323-2333-180c-227d02260acf -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Webserver.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/var/lib/libvirt/images/Webserver.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:f6:a1:37,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:1 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
18380 ?        Sl    19:32 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 10000 -smp 8,sockets=8,cores=1,threads=1 -name Gameserver1 -uuid cb7b70e3-f049-7545-65d2-3adff36f34ff -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Gameserver1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device ahci,id=ahci0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/Gameserver1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/var/lib/libvirt/images/Gameserver1-1.img,if=none,id=drive-sata0-0-0,format=raw -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:62:7d:6e,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:2 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

He left me also the following notices:

For the "Gameserver1":

root: kecks
user : game
pass: ***

ip: 192.168.122.161
FTP connection : ftp://***:2121

IP-Tables:
        //FTP: (Chrooted)
        49152-49153 (FTP Passive)
        2121 -> 21
        2020 -> 20
        //CS:GO 
        27015

And also e. g. for the "Webserver":

##User
root -> ***
webserver -> ***

192.168.122.198
Mysql root -> ***


ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:12001 // FTP
ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:12000 //FTP
ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:ftp-data
ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:ftp
ACCEPT     tcp  --  anywhere             192.168.122.198      state NEW,RELATED,ESTABLISHED tcp dpt:http

Maybe it´s helpful for system administrators which have already worked with this tools, but for me not really.

The XML configuration files for the VMs are only generated. So in my opinion it´s not needed here. The server is running under Ubuntu 12.04.3 LTS. All my tryings to access it via complex ssh and vnc commands brought me only to the host machine, not to the VM. Of course I tried this locally with a ssh connection on the host machine, because I saw only class C local IPv4 address.

Edit: Solved with the two answers below. The solution is to establish a ssh connection to class c ip-adresses inside the ssh session to the host machine.

1

-vnc 127.0.0.1:x: use a VNC terminal emulator to connect to the virtual terminal on port 5900+x at localhost where you can use the given credentials.

  • how can I find out which vnc client is installed? I mean, the guy before should have also used a vnc client. Edit: aptitude is not very helpful, it shows only some libs for vnc. – alpham8 Aug 8 '14 at 21:51
  • There are plenty of VNC clients - I'm afraid you have to try each one, unless you can inspect the command line history of the admin. – countermode Aug 8 '14 at 22:38
2

To Start your VM using comamnd

# virsh start Gameserver1

To List the running servers

# virsh list 

To access the server in console

# virt-viewer Gameserver1

This will open the console of your server so that you can access it graphically

To shutoff the Virtual machine use

# virsh destroy Gameserver1

To install the package

if you use centos ir fedora please install the below package

# yum install qemu libvirt-client virt-manager \
  virt-viewer guestfish libguestfs-tools virt-top

If you use debian based or ubuntu please install the below

# sudo apt-get install kvm libvirt-bin virt-manager virt-viewer virt-top virt-what

This will fix your issue

  • 1
    ok, I installed virt-viewer. But it breaks with the message: "cannot open display:" – alpham8 Aug 8 '14 at 21:50
  • Please have a note on above modified answer above, i have added the installation steps to get work for the virt viewer. – Babin Lonston Aug 9 '14 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.