LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Connecting to a KVM VM from a non-graphical host (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/connecting-to-a-kvm-vm-from-a-non-graphical-host-4175621366/)

sallback 01-10-2018 01:14 PM

Connecting to a KVM VM from a non-graphical host
 
My first post, so be gentle. ;)

I'm currently playing around with a Centos7 KVM host running a Windows 7 VM. I've already been able to access the VM using VNC from another computer or connecting to it from the host's XCFE desktop environment using virt-viewer.

I was just wondering if is it possible to access the VM from the host itself if it does not have any graphical inteface installed at all?

Basically what I am trying to achieve is a light as possible KVM host which runs the windows VM and the VM is accessed somehow straight from the same host via command line only and without a need to install any desktop environment. Is this even possible or is some kind of a graphical interface needed?

The reason for this setup is that I could experiment stuff with the VM and if/when s*it hits the fan, I could just use snapshot to revert back to previous state.

Timothy Miller 01-10-2018 01:33 PM

Without a desktop, sure, you can use xfreerdp or still use virt-viewer like currently. You'll still need a configured working X environment, but you don't need to actually be running a desktop. You can boot to CLI as long as passing startx would work to start an X-session, you should be fine.

sallback 01-13-2018 07:23 AM

Thank you for the help so far.

I've now played with the system for many hours in many days and I can't seem to find an answer to my current problem.

I've made a few rounds of reinstalling and starting from scratch, but I always get stuck to the same field of mines so to speak. I have a hard time understanding what is the problem with my X / Xorg settings.

If I make an SSH connection from another computer in the same network using X-forwarding option to the virtualization host, I can get the virt-manager running without any problem but the tricky part for me is to get the virt-manager to run directly from the virtualization host itself.

When trying to just launch virt-manager from the console, I get an error stating Gtk-WARNING **: cannot open display:

If I try with the SSH and connect from the host back to the host itself (dont' actually have any point for this but just tried it as it worked from the other pc), I get the same error Gtk-WARNING **: cannot open display:

Now I have googled numerous guides for solving this and tried a load of different tricks (and sometimes ended up reinstalling the system from scratch) but without an luck.

Could somebody give me some instructions on how to get forward from this point?
What packages do I have to install while keeping the system as minimal as possible?
Which configuration files I have to change?
What is the actual reason for this error?

I will give more information when requested but as said before I have tried so many different guides and tutorials with no luck that my mind is just full of trivia around the subject without any straight plan to getting forward.

Thank you in advance.


All times are GMT -5. The time now is 08:01 PM.