AlexSSD7 / linsk

📂 Access Linux-native file systems (including LVM and LUKS) on Windows and macOS with help of a lightweight Alpine Linux VM. x86/ARM supported.
GNU General Public License v3.0
303 stars 13 forks source link

Predefine DNS Servers in the VM #21

Open HugoPlatzer opened 1 month ago

HugoPlatzer commented 1 month ago

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.

AlexSSD7 commented 1 month ago

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!