abiosoft
(Abiola Ibrahim)
July 23, 2024, 10:09pm
1
Incus support has been added to Colima , a tool that provides easy access to container runtimes on macOS.
Feedbacks would be appreciated.
Getting started with Incus on macOS with Colima
Install dependencies
# install incus client
brew install incus
# incus development version of Colima
brew install --head colima
Start Colima using Incus runtime
colima start --runtime=incus
Start using Incus
$ incus version
Client version: 6.3
Server version: 6.3
$ incus list
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
$ incus info --resources | head -n5
System:
Vendor: QEMU
Product: QEMU Virtual Machine
Version: virt-9.0
Type: virtual-machine
It feels native, how does it work?
Colima starts an Ubuntu VM with Incus pre-installed using QEMU (or macOS Virtualization.Framework).
Incus unix socket is forwarded to the macOS host
Incus client (on macOS) is configured to utilise the forwarded unix socket. Automatically configured and removed on Colima startup and shutdown.
Other features
Incus UI available at https://localhost:8443
Volume mounts - $HOME is mounted into the Incus VM
Port forwarding - all ports exposed to the VM is forwarded to macOS. e.g. a proxy
device listening on 8080
is accessible on localhost:8080
on macOS.
Docker remote is pre-configured for OCI images. e.g. incus launch docker:caddy
should just work.
Limitations
Only containers are supported, no virtual machines.
Containers are not accessible on the host via the bridge IP address, unless it is further exposed to the host e.g. via proxy
device.
3 Likes
abiosoft
(Abiola Ibrahim)
July 25, 2024, 10:02am
4
While testing I realised that it is possible to run x86_64 binaries utilising either QEMU or Rosetta (even in a nested container i.e. Docker in Incus)
root@aca2def12571:/# ps faux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 1.8 0.2 179432 5352 pts/0 Ss 10:01 0:00 /mnt/lima-rosetta/rosetta /bin/bash
root 9 83.3 0.2 182476 4608 pts/0 R+ 10:01 0:00 /usr/bin/ps faux
abiosoft
(Abiola Ibrahim)
August 4, 2024, 5:37pm
5
Nested Virtualization is now supported on m3 Macs running macOS 15 or later.
Colima may soon be able to support virtual machines for Incus runtime.
This is Incus running on a Debian VM on macOS, able to launch both containers and virtual machines.
1 Like
stgraber
(Stéphane Graber)
August 4, 2024, 6:35pm
6
Nice! That’s great to see, will make it possible to use all of Incus on MacOS then!
How’s the performance for those VMs? Is there any known amount of overhead on the nested virtualization?
abiosoft
(Abiola Ibrahim)
August 4, 2024, 8:22pm
7
Looks like performance is impressive and the overhead is minimal.
Geekbench kept freezing in the multi-core tests, so I had to limit the VM to single CPU to get it to complete successfully. I am mainly interested in the single-core performance anyways.
You can suggest other tests or benchmarking tools to use.
The left window is the VM, right is the nested VM.
Link to the VM result: Apple Inc. Apple Virtualization Generic Platform - Geekbench
Link to the nested VM result: QEMU KVM Virtual Machine - Geekbench
1 Like
abiosoft
(Abiola Ibrahim)
August 5, 2024, 2:20pm
8
After having tested it successfully, PRs have been created in upstream projects.
When they both get merged, Incus virtual machines would be supported in Colima.
Code-Hex:main
← abiosoft:enable-nested-virtualization
opened 01:07PM - 05 Aug 24 UTC
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If thi… s is your first time, please read our contributor guidelines: https://github.com/Code-Hex/vz/blob/master/CONTRIBUTING.md
2. Please create a new issue before creating this PR. However, You can continue it without creating issues if this PR fixes any documentations such as typo.
3. Do not send Pull Requests for large (150 ~ lines) code changes. If so, I am not motivated to review your code. Basically, I write the code.
-->
## Which issue(s) this PR fixes:
This PR adds support for nested virtualization, [added in macOS 15 for m3 devices](https://developer.apple.com/documentation/virtualization/vzgenericplatformconfiguration/4360553-nestedvirtualizationsupported?language=objc)
## Additional documentation
Sample usage
```go
platformConfig, err := vz.NewGenericPlatformConfiguration(vz.WithGenericMachineIdentifier(machineIdentifier))
if err != nil {
return err
}
// nested virt
platformConfig.SetNestedVirtualizationEnabled(true)
```
<!--
This section can be blank.
-->
lima-vm:master
← abiosoft:vz-nested-virtualization
opened 02:12PM - 05 Aug 24 UTC
This PR adds support for nested virtualization for the VZ driver via the `nested… Virtualization` yaml config.
It is dependent on upstream PR https://github.com/Code-Hex/vz/pull/159 getting merged.
Nested virtualization is currently limited to m3 devices running macOS 15 or newer.
1 Like
stgraber
(Stéphane Graber)
August 5, 2024, 4:00pm
9
Great to see! Very impressive indeed!