KVM As A Desktop

Home » CentOS » KVM As A Desktop
CentOS 13 Comments

I am nearing the end of a project that moved our disparate services and hosts onto kvm virtualized servers. What I am now contemplating is setting up my desktop as a virtual host and using one of the guests as my primary workstation.

However, I am not sure how this would work in practice. I am accustomed to working with virtual instances via SSH (a terminal window) and with my Desktop system in a Gnome window manager. Is there a reference somewhere that outlines the mechanics of logging into a virtual guest‘s graphical desktop directly from the physical console of the kvm host system?

13 thoughts on - KVM As A Desktop

  • CentOS 6 Manuals are not yet available but the upstream docs are here:

    https://access.redhat.com/knowledge/docs/Red_Hat_Enterprise_Linux/

    You probably want to start here:
    (watch for line-wrap)

    https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/index.html

    To open a graphical console on your virtual desktop from the KVM host:
    (you’ll probably do this when you create your VM anyway)
    ========================================================[Applications]->[System Tools]->[Virtual Machine Manager]

    Authenticate dialog opens

    Password for root: [your_root_password]

    Button: [Authenticate]

    VM Manager window opens First connection is highlighted (default is localhost (QEMU))
    Virtual machines under connection are displayed

    Double-click desired VM

    Native console of VM opens

    etc.
    ========================================================
    KVM uses VNC to connect to the guest machines’ consoles and by default will automatically assign the next available VNC port, beginning with
    5900. I would highly recommend manually configuring your first guest’s display (Display VNC) with VNC port 5901 and let subsequent VM’s get assigned automatically. Otherwise, there will be a conflict with
    “tigervnc-server-module” if you later wish to connect remotely to the physical server (KVM host). If auto-configured the first VM will get port 5900 which the Xorg VNC module expects to be reserved for the
    (physical) host’s console port. The port on which the Xorg module listens cannot be changed easily.

    ./Cal

  • I like to use freenx to host the desktop and the NX client to display it. That should work regardless of whether the desktop is a VM or not and regardless of the OS or location of the display – and it wouldn’t surprise me if it performs better than whatever the built-in KVM
    mechanism uses. Even if you normally work locally, you may find it handy to be able to pick up the display from elsewhere with everything still running and have good performance.

  • Seconded. I use freenx, too. For me, it provides a better experience than VNC, Radmin, RDP, PCoIP (even on a zero client device), and whatever VMware uses when you open a console in vSphere Client. That goes for speed and smoothness of display updates and even just copying and pasting text into the remote machine.

  • Actually, I posted my question after reading that very page. I did not want to start down some technically involved path if a simpler solution was already widely used. I also will take a look at FreeNX
    as others have suggested.

    Thank you all for the suggestions and references.

  • The free version of NX may be on the way out, but currently freenx has the advantage of being a ‘yum install’ that comes up working with the still available 3.x versions of NX. All you have to do is copy/paste the unique key that the install will generate from
    /etc/nxserver/client.id.dsa.key into the client config window, pick unix, gnome desktop, and connect. Normally the only thing I touch in the server config is to adjust DISPLAY_BASE to be unique since I often run multiple sessions as the 1st and only user on different targets which would otherwise get the same display number but that won’t be necessary on your first install.

    x2go may have more current work and better support for sound, mapped drives, etc., but I normally just use those facilities from the host with the display or the native network support from host running the desktop.

  • I do several Windows desktops with spice

    I think I would use freenx for a linux desktop .. unless sound is important, then spice would be my choice.

  • Hi,

    You could use virt-manager/virt-viewer + SPICE, it shows a lot of promise and it works reasonably well, especially over low latency links, but ATM you could be better off with using NX or FreeRDP (for Windows)
    from within the guest.

  • Yesterday I tried both spice and FreeRDP connecting to a Win7 x64 VM on an F17 laptop. FreeRDP feels much more responsive and even the Big Buck Bunny video (h.264 854×480) played smooth with video & sound in sync. On F17 you will need to rebuild FreeRDP with alsa and ffmpeg support enabled.

    Regards, Patrick

  • One nice thing is that when you update/change/switch distros, etc., you can run old/new in parallel. Another is that you can easily move the VM elsewhere if resources are available and it is mostly transparent to your use as a desktop.

    Freenx/NX does all the same things as native remote X, but with better remote performance and the ability to disconnect and reconnect (even from a different display) with everything still running. There is probably some memory overhead for the proxy/cache buffers, though.

  • Presently I build kvm hosts with a minimal install and add whatever packages are required to get kvm working and provide my customary administrative tools. The kvm guests get the user applications. I
    simply want to have a similar arrangement on my personal workstation so that my experiments do not become invisibly dependent upon something I have installed for my own use.

    Basically, I want to simply leave the host configuration alone once kvm is running and do my mucking about in a virtual machine.

LEAVE A COMMENT