
Ubuntu VM on macOS with libvirt+QEMU - rubatuga
https://www.naut.ca/blog/2020/08/26/ubuntu-vm-on-macos-with-libvirt-qemu/
======
runjake
Small tweak: you do not need to install RealVNC Viewer. macOS already comes
with a high performance VNC client:

/System/Library/CoreServices/Applications/Screen Sharing.app

You can drag it to the Dock or use Spotlight to find it, as it is indexed by
default.

~~~
rubatuga
When I tried using the built in VNC client, it asked for a password and
wouldn't accept any value I gave it. I only got QEMU to work with 3rd party
VNC viewers. If somebody can figure out how to use the built in one, that
would be great.

~~~
m463
I'm uncertain specifically what VNC connects to in the vm situation. Is it
127.0.0.1 or the address of the vm?

Maybe you have screen sharing already turned on?

    
    
      netstat -an -p tcp
    

(is anything on port 5900?)

Anyway, I use screen sharing a lot using SSH port forwarding on macos.

If a maching foo is running a vnc server, I put something like this in
.ssh/config:

    
    
      Host foo
        (other settings)
        LocalForward 5900 localhost:5900
    

to make screen sharing accessible, I add it to the dock.

select finder. then open a folder in finder:

    
    
      command-shift-G /System/Library/CoreServices/Applications
    

Drag "Screen Sharing.app" to the dock.

Then log into the remote machine:

    
    
      $ ssh foo
      <etc>
      foo$ 
    

Now back to the dock click on Screen Sharing.

It will ask you for a host name. Enter 127.0.0.1 and press connect.

this will connect to localhost:5900 which ssh will port forward to foo and
dump on foo's localhost:5900

bottom line - you will connect to foo port 5900 via screen sharing.

------
fulafel
There's also a good argument for using qemu without libvirt, for those who
dislike libvirt's complexity. See eg
[https://news.ycombinator.com/item?id=19737289](https://news.ycombinator.com/item?id=19737289)

libvirt is most useful if you use it to abstract over different virtualization
backends, like vmware/kvm/lxd etc.

~~~
stubish
If easy is the goal, have a look at Multipass
([https://multipass.run/docs/installing-on-
macos](https://multipass.run/docs/installing-on-macos)), which uses hyperkit
as the backend
([https://github.com/moby/hyperkit](https://github.com/moby/hyperkit))

~~~
rubatuga
This looks pretty cool!

------
unixhero
What is the abstraction layer for virtualization natively available in MacOSX?

~~~
tinus_hn
It’s the Hypervisor Framework:

[https://developer.apple.com/documentation/hypervisor](https://developer.apple.com/documentation/hypervisor)

which Apple oddly is introducing for Intel Macs only in MacOS 11, at the same
time they’re introducing support for non Intel ‘Apple hardware’ Macs.

~~~
xodice
The Hypervisor framework has been in macOS since at least Mojave (if not
longer, this is just what I began using it), it's not new to macOS 11.

~~~
toyg
They might be introducing a GUI or something, which is what it still lacks
(there are some 3rd-party products out there, none particularly impressive
last I checked).

~~~
xodice
Parallels can interface with the Hypervisor Framework instead of it's own, so
there is at least one decent GUI. However performance compared to the
Parallels hypervisor is _very_ poor.

I would be interested in an Apple VM app overlay for the integrated Hypervisor
though! And hopefully we see some speed improvements. :)

