wfvm: cleanup, move QEMU netdev settings out of defaults

This commit is contained in:
Sebastien Bourdeauducq 2020-06-14 19:26:43 +08:00
parent 70c6a212e2
commit cc14162e60
1 changed files with 5 additions and 9 deletions

View File

@ -53,13 +53,11 @@ let
# Packages required to drive installation of other packages # Packages required to drive installation of other packages
bootstrapPkgs = bootstrapPkgs =
runQemuCommand "bootstrap-win-pkgs.img" '' runQemuCommand "bootstrap-win-pkgs.img" ''
mkdir pkgs mkdir -p pkgs/fod
mkdir pkgs/fod
cp ${bundleInstaller} pkgs/"$(stripHash "${bundleInstaller}")" cp ${bundleInstaller} pkgs/"$(stripHash "${bundleInstaller}")"
# Install optional windows features # Install optional windows features
cp ${openSshServerPackage} pkgs/fod/OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab cp ${openSshServerPackage} pkgs/fod/OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab
# SSH setup script goes here because windows XML parser sucks # SSH setup script goes here because windows XML parser sucks
@ -82,13 +80,7 @@ let
"virtio" "virtio"
"-device" "-device"
"piix3-usb-uhci" # USB root hub "piix3-usb-uhci" # USB root hub
# "CD" drive with windows features-on-demand
# "-cdrom" "${fodIso}"
# Set the base clock inside the VM
"-rtc base=${baseRtc}" "-rtc base=${baseRtc}"
# Always enable SSH port forward
# It's not really required for the initial setup but we do it here anyway
"-netdev user,id=n1,net=192.168.1.0/24,restrict=off,hostfwd=tcp::2022-:22"
"-device e1000,netdev=n1" "-device e1000,netdev=n1"
] ++ lib.optional (!impureMode) "-nographic" ++ extraFlags; ] ++ lib.optional (!impureMode) "-nographic" ++ extraFlags;
@ -108,6 +100,8 @@ let
# Output image # Output image
"-drive" "-drive"
"file=c.img,index=0,media=disk,cache=unsafe" "file=c.img,index=0,media=disk,cache=unsafe"
# Network
"-netdev user,id=n1,net=192.168.1.0/24,restrict=on"
]; ];
in in
'' ''
@ -170,6 +164,8 @@ let
# Output image # Output image
"-drive" "-drive"
"file=c.img,index=0,media=disk,cache=unsafe" "file=c.img,index=0,media=disk,cache=unsafe"
# Network - enable SSH forwarding
"-netdev user,id=n1,net=192.168.1.0/24,restrict=on,hostfwd=tcp::2022-:22"
]; ];
in '' in ''