From 678f0c869886ad963da6fb249f3884410b118ad0 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Sat, 25 Nov 2023 22:52:17 -0800 Subject: [PATCH] Make sure all network interfaces are routable This is a workaround for https://github.com/rancher-sandbox/rancher-desktop/issues/6051 It makes sure the boot-time /etc/network/interfaces file is copied to the persisted location and then restarts the networking service yet one more time. This workaround should be removed when the issue is fixed upstream. Signed-off-by: Jan Dubois --- pkg/rancher-desktop/assets/lima-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/rancher-desktop/assets/lima-config.yaml b/pkg/rancher-desktop/assets/lima-config.yaml index 89d78a35fc8..3ec3e6c9cfd 100644 --- a/pkg/rancher-desktop/assets/lima-config.yaml +++ b/pkg/rancher-desktop/assets/lima-config.yaml @@ -18,6 +18,13 @@ provision: mkdir -p /bootfs mount --bind / /bootfs # /bootfs/etc is empty on first boot because it has been moved to /mnt/data/etc by lima + + # Workaround for https://github.com/rancher-sandbox/rancher-desktop/issues/6051 + # should be removed when the issue is fixed in Lima itself + if [ -f /bootfs/etc/network/interfaces ] && ! diff -q /etc/network/interfaces /bootfs/etc/network/interfaces; then + cp /bootfs/etc/network/interfaces /etc/network/interfaces + rc-service networking restart + fi if [ -f /bootfs/etc/os-release ] && ! diff -q /etc/os-release /bootfs/etc/os-release; then cp /etc/machine-id /bootfs/etc cp /etc/ssh/ssh_host* /bootfs/etc/ssh/