Skip to main content
2 of 4
added 1 character in body
MariusMatutiae
  • 47.8k
  • 12
  • 82
  • 131

You can definitely have a GUI on your VM. It just requires a minimum setup.

The easiest is to use a Linux/Unix (Mac included) pc to access your VM, because then all you need to do is the following:

  1. On the VM, edit the file /etc/ssh/sshd_config, and make sure you have these two lines:

     X11Forwarding yes
     X11DisplayOffset 10
    

and restart the ssh daemon,

    systemctl force-reload ssh
  1. On your Linux pc, connect with the command:

     ssh -Y [email protected]
    

then make sure the graphical display is correctly selected,

    export DISPLAY=localhost:10.0

and now from within the ssh session you can start graphical applications which will be displayed on your Linux pc monitor. Try, for instance,

    xeyes

In line of principle, there is a way to start a whole Desktop Environment (KDE, Gnome, Xfce, Enlightenment, you name it) on the VM, and have it displayed on your Linux pc, but this requires very large bandwidths, so I will not tell you how to do it unless you explicitly ask.

The reason why you were not initially offered this solution is that most people seem to forget that Xorg, the Linux graphical interface, is a server, i.e. it performs the service of displaying on the monitor it is running on the graphical applications which send it data, whether they come from the local or a remote pc. So your Xorg session is perfectly capable of doing this.

If instead you are connecting from a Windows pc, vnc will do that for you, but this requires that you have an Xorg session on the VM, to which vnc connects and replicates it locally, albeit with much worse resolution. If this what you wish to do, you may read here.

MariusMatutiae
  • 47.8k
  • 12
  • 82
  • 131