1

Priorities:

Security has high priority in all aspects. Scalability, ease of use and price are close seconds and performance also have a say.

What I am trying to do:

I am trying to run a minimal (and therefore without GUI) install of linux run a vm with windows (including GUI). The linux part only needs responsibility for starting the windows client and providing security.

I am currently trying to do it by utilising kvm. I have managed to get it to work through the command line, but only inside a desktop system e.g. GNOME. I ran it through libvirt (virt-install) and virt-viewer and also made it work as described in this guide.

I am running CentOS atm but it was primarily to choose an OS, so suggestions about smaller images with specific advantages are welcome.

The problem:

When I try the 2 options above from none desktop environment I get: Gtk-WARNING **: [current time]: cannot open display: I have tried to do some googling, but I keep finding posts about headless servers and X11. I am not trying to make a headless server and I am not sure how X11 should fix my problem.

Request:

How do I start a vm (windows with GUI) from the terminal on a system which doesn't have a GUI (linux without desktop).

4
  • 1
    Sorry, I'm unclear why KVM has anything to do with a server for gold images. I'm also confused how (or why) you're trying to run Gnome on a headless server. Or is Gnome supposed to be running on a VM? Are you running raw KVM machines, or are they managed through something like libvirt or even Proxmox? (Please edit your question to provide clarification, not as footnotes but in the text as if you'd thought of it yourself.) Feb 18, 2019 at 9:02
  • For what is X11: see unix.stackexchange.com/a/149075/4778 for what X11 is. You don't need a desktop environment like Gnome, but you do need an X11 display (These thinks are separate ideas in X11). You will only need it on the client machines (where use user site, where you are running the VMs, with MS-Windows on top). Also headless in this context means without display (you need this for the GUI, unless you do it over the network. Maybe to thin clients)). Feb 18, 2019 at 9:23
  • Thank you for the clarification questions @roaima, I hope I have made them clear.
    – Mr Matten
    Feb 18, 2019 at 10:24
  • @ctrl-alt-delor The X11 display sound like what I need, but not entirely sure. Does your comment still make sense after my edits?
    – Mr Matten
    Feb 18, 2019 at 10:24

4 Answers 4

1

For the client machines: where the MS-Windows on VM, will be run. You will need an X11 server.

X11 server

X11 is part of the windowing system used on Gnu/Linux, Unix, VMS, and some other systems. It combines a canvas, keyboard, mouse. The X server is not the windowing system, but is needed to run one.

Beware many people think of a server as being remote. This is false. An X11 server runs locally. The clients can run remotely.

A windowing system e.g. Gnome.

Is made of

  • The window-manager: responsible for moving, resizing, lowering, raising, windows.
  • Task manager, start button, notification area, etc.

You don't need a windowing system, especially if you only run one window. There are other tools that can make a window become full screen.

4
  • Thank you for the explanation! Which tools fx?
    – Mr Matten
    Feb 20, 2019 at 13:17
  • @MathiasEgekvist I don't know them all, but xdotool is one. If this is what you need, then ask another question. Feb 21, 2019 at 9:24
  • It was not precisely what I was looking for, but it led me to understand more of what I needed to know, which was to understand what X11 was doing and how I needed it and that the server and guest can be one and the same computer.
    – Mr Matten
    Mar 21, 2019 at 14:34
  • @MathiasEgekvist people get confused, because when they see all the examples of servers: If we notice a remote machine, it is because of its servers. Therefore we create a model that servers are remote. This is not the case, me have words for this idea (local and remote). X11 servers are local to the user. Mar 21, 2019 at 16:51
1

I have gotten this working using xinit. It requires that you have xorg and virt-manager already installed. I used the command xinit virt-viewer -- :0 vt${XDG_VTNR} and it worked just fine. More info at https://linuxconfig.org/how-to-run-x-applications-without-a-desktop-or-a-wm

0

I read that you have a hypervisor machine running Linux that will run a VM, and that VM needs to have a graphical environment. But the hypervisor does not have a graphical environment and probably doesn't even have a display.

What you should do instead is to install virt-manager on your own workstation, and the configure virt-manager to make a connection (via ssh tunnel) to the hypervisor machine. You can then manage the VMs running on that machine from your workstation, including viewing the graphics console of the VM, with all data sent over the ssh tunnel.

6
  • Sorry for the bad description. The first paragraph is correct, but my idea is to run the client on the host, if that makes sense. The host do have a display but only terminal.
    – Mr Matten
    Feb 20, 2019 at 13:17
  • How will you see it? Feb 20, 2019 at 15:56
  • So there is only one PC with a display attached, which runs CentOS without GUI. From there I need to open a Windows10 VM with GUI. I hope that answers your question :)
    – Mr Matten
    Feb 21, 2019 at 11:59
  • You can't see a GUI without a workstation to run a virtual machine viewer on! Feb 21, 2019 at 14:02
  • So it is not possible to run a VM from the terminal on the same PC? Or do I need to install a virtual machine viewer? If that is the case do you have any recommendations?
    – Mr Matten
    Feb 21, 2019 at 14:31
0

From the sounds of it you are trying to run a windows VM on KVM with PCI pass-through of the graphics card, without the host OS taking control of it. I have not personally tried to run a set-up like this but I understand some people have had success with running two graphics cards and giving control of the second to the VM.

https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/

In the tutorial they mention that,the UEFI firmware initializes the GPU and loads a modified vBios from the GPU. This can cause problems if you try to pass through the only GPU attached to the computer.

When booting these host platforms, the host UEFI initializes the GPU and makes a somewhat modified “shadow copy” of the GPU’s vBIOS. Later when you start the VM, Linux exposes this crippled shadow BIOS to the guests UEFI loader. The same happens when you try to passthrough your primary (and only) GPU to the guest. A telltale sign is the following error when running the VM start script:

qemu-system-x86_64: -device vfio-pci,host=02:00.0,multifunction=on: Failed to mmap 0000:02:00.0 BAR 3. Performance may be slow

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .