linsk icon indicating copy to clipboard operation
linsk copied to clipboard

Predefine DNS Servers in the VM

Open HugoPlatzer opened this issue 1 year ago • 1 comments

When trying to install linsk on my macbook (M1 chip, macos 15.0.1), setting up the VM with ./linsk build fails due to this error: bad address mirrors.alpinelinux.org. This is because the nameserver 10.0.2.3 that I guess udhcp sets up does not work.

To fix this, I changed this line in imgbuilder.go:

cmd := "ifconfig eth0 up && ifconfig lo up && udhcpc && true > /etc/apk/repositories && setup-apkrepos ...

to override the nameserver like so:

cmd := "ifconfig eth0 up && ifconfig lo up && udhcpc && echo 'nameserver 8.8.8.8' > /etc/resolv.conf && true > /etc/apk/repositories && setup-apkrepos ...

Maybe there is a better way to do this, but I can confirm linsk works on my system after making this change.

HugoPlatzer avatar Oct 05 '24 02:10 HugoPlatzer

I think it's related to #1.

Speaking of predefining the DNS servers, that sounds like a good idea — something to put on the TODO list. Thanks for the suggestion!

AlexSSD7 avatar Oct 22 '24 17:10 AlexSSD7