1
Fork 0

wsl: remove /etc/hosts symlink

This commit is contained in:
Alan Faubert 2025-01-02 10:52:04 -05:00
parent fce4d3dd6a
commit 5b04867bc8

View file

@ -4,5 +4,5 @@ echo Arguments: ^<filesystem.tar.gz^> ^<destination directory^> ^<distribution n
exit /b 1
:run
wsl.exe --import %~3 "%~2" "%~1" --version 2
wsl.exe --distribution %~3 -- adduser %~4; adduser %~4 sudo; echo $'[network]\n\tgenerateHosts = false\n[user]\n\tdefault = %~4' ^> /etc/wsl.conf; chmod 644 /etc/wsl.conf; ln --force --relative --symbolic "$(wslpath "%WINDIR%")"/System32/drivers/etc/hosts /etc/hosts
wsl.exe --distribution %~3 -- adduser %~4; adduser %~4 sudo; echo $'[user]\n\tdefault = %~4' ^> /etc/wsl.conf; chmod 644 /etc/wsl.conf
wsl.exe --terminate %~3