cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.91k stars 116 forks source link

no IP address found for Ubuntu VM #912

Closed barkingfoodog closed 1 month ago

barkingfoodog commented 2 months ago

I'm running tart 2.18.4 on macOS Sequoia 15.0. Tart works fine with a macOS image, and I'm trying to get an Ubuntu VM going for the first time.

I followed the basic steps from https://tart.run/quick-start/:

tart clone ghcr.io/cirruslabs/ubuntu:latest ubuntu
tart set ubuntu --disk-size 50
tart run ubuntu

The VM downloads, boots up, and I can log into through the tart GUI. However, I'm unable to get the VM IP using tart ip ubuntu. Instead I get:

no IP address found

I found #632 and tried the workaround from #657 but that doesn't help. After clearing /var/db/dhcpd_leases and restarting the VM I get output that looks legit in /var/db/dhcpd_leases:

{
    name=ubuntu
    ip_address=192.168.64.2
    hw_address=ff,f1:f5:dd:7f:0:2:0:0:ab:11:b5:58:a4:8e:38:af:82:b9
    identifier=ff,f1:f5:dd:7f:0:2:0:0:ab:11:b5:58:a4:8e:38:af:82:b9
    lease=0x66fa772c
}

This matches the IP inside the VM (confirmed using ifconfig).

I have an OpenVPN Connect VPN running, but disabling it doesn't seem to make any difference. I don't have any issues getting the IP address from a macOS VM running under tart.

Any compatibility issues with macOS 15 or other troubleshooting ideas for how to get tart ip ubuntu returning the VM's IP address?

edigaryev commented 2 months ago

Looks like a bug in the macOS DHCP server:

Screenshot 2024-09-30 at 14 28 41

It uses the client ID not just in the identifier= field, but also in hw_address= field, yet this field's name hints that it should only contain a MAC-address.

I've created https://github.com/cirruslabs/linux-image-templates/pull/38 to address this in our Linux VM images.

barkingfoodog commented 2 months ago

Thank you! I'll watch for the next Linux VM build and confirm the fix before closing this.

barkingfoodog commented 1 month ago

@edigaryev I saw new builds come through a couple days ago at https://github.com/cirruslabs/linux-image-templates/pkgs/container/ubuntu. I pulled a fresh copy of the 22.04 image and I'm still not getting an IP from tart ip ubuntu.

Should those images have the fix from https://github.com/cirruslabs/linux-image-templates/pull/38?

edigaryev commented 1 month ago

@barkingfoodog my bad, I was testing the fix on the initial boot, which still used the network-config provided to the Cloud Init.

I've created https://github.com/cirruslabs/linux-image-templates/pull/39 to fix this and will initiate a re-build of base images once it gets merged 🙌

edigaryev commented 1 month ago

Should work now, tested with the latest versions of:

barkingfoodog commented 1 month ago

@edigaryev I can confirm this works now with ghcr.io/cirruslabs/ubuntu:latest using Tart 2.18.4 on macOS Sequoia 15.0.1. Thank you!