Skip to content

Commit

Permalink
update qemu arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ifurther committed Jun 27, 2024
1 parent a443a4b commit 7ba4251
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nixos.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ source "qemu" "qemu" {
http_directory = "scripts"
iso_checksum = var.iso_checksum
iso_url = local.iso_url
qemuargs = [["-m", var.memory]]
qemuargs = [
["-m", var.memory],
[ "-netdev", "user,hostfwd=tcp::{{ .SSHHostPort }}-:22,id=forward"],
[ "-device", "virtio-net,netdev=forward,id=net0"]
]
shutdown_command = "sudo shutdown -h now"
ssh_port = 22
ssh_private_key_file = "./scripts/install_ed25519"
Expand All @@ -150,7 +154,11 @@ source "qemu" "qemu-efi" {
http_directory = "scripts"
iso_checksum = var.iso_checksum
iso_url = local.iso_url
qemuargs = [["-m", var.memory]]
qemuargs = [
["-m", var.memory],
[ "-netdev", "user,hostfwd=tcp::{{ .SSHHostPort }}-:22,id=forward"],
[ "-device", "virtio-net,netdev=forward,id=net0"]
]
shutdown_command = "sudo shutdown -h now"
machine_type = "q35"
ssh_port = 22
Expand Down

0 comments on commit 7ba4251

Please sign in to comment.