utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
27.09k stars 1.34k forks source link

VNC support for Virtualization.framework #3721

Open KarimGeiger opened 2 years ago

KarimGeiger commented 2 years ago

Hello,

I saw that with qemu there's an option to get VNC access to the guest VM (without having to install a VNC server on the guest). However, this seems to not be possible with macOS guests, as they use the Virtualization.framework instead of qemu.

I would assume that it is quite a challenge to implement a VNC server on a hypervisor level for macOS guests as well, or is this something that's already happening internally and can be easily exposed?

The reason I'm asking is because I would like to access my guest macOS VM through the network and running a local screen sharing/VNC server always comes with the risk of not having access to the VM in case it freezes, so having this externally would be quite awesome.

Thanks!

osy commented 2 years ago

Is it not possible to run a vnc server inside the vm?

KarimGeiger commented 2 years ago

Of course, that is an option, but as stated above: „[…] running a local screen sharing/VNC server always comes with the risk of not having access to the VM in case it freezes, so having this externally would be quite awesome.“

conath commented 2 years ago

Of course, that is an option, but as stated above: „[…] running a local screen sharing/VNC server always comes with the risk of not having access to the VM in case it freezes, so having this externally would be quite awesome.“

Sorry to interject. I'm not getting it, either you run a VNC in the host (outside the VM) or inside the VM, why to you need the in-between VNC for just the VM instance?

adespoton commented 2 years ago

Of course, that is an option, but as stated above: „[…] running a local screen sharing/VNC server always comes with the risk of not having access to the VM in case it freezes, so having this externally would be quite awesome.“

Sorry to interject. I'm not getting it, either you run a VNC in the host (outside the VM) or inside the VM, why to you need the in-between VNC for just the VM instance?

As someone who used RDP for VirtualBox for years... you don't use VNC inside the guest because you want full control of the guest from initial boot, including any EFI menus, etc. You don't use VNC in the host because that provides access to the entire host system, so is less secure, especially if spinning up snapshots for remote users to use.

At this point, anyone with such a use case is probably better served by vanilla QEMU instead of UTM, but if UTM is aiming to become a VirtualBox replacement (which is how many appear to be viewing it), that's one of the features people use. Although VNC seems like a bad choice compared to RDP, due to latency and bandwidth use.

What I'd really like to see is someone update VNC for modern hardware and use, possibly using a DisplayPDF profile and support for hardware acceleration on server and client, plus all the other add-ons that Apple has added to their closed-source version.

freebrowser1 commented 2 years ago

Indeed, I installed TigerVNC on a Ubuntu 20.04 guest and it did start following the instructions how to install on Ubuntu. When running the nmap port scan utility from Homebrew on the host Mac showed VNC port 5901 was open and a RealVNC client for macOS told it could connect, asked for a password, but it could not connect. That is not a RealVNC client problem as other VNC servers connect normally.