Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows image build with kvm stuck at winrm(booting from floppy) #319

Open
weinix opened this issue Jul 26, 2022 · 1 comment
Open

windows image build with kvm stuck at winrm(booting from floppy) #319

weinix opened this issue Jul 26, 2022 · 1 comment

Comments

@weinix
Copy link

weinix commented Jul 26, 2022

Thanks for your work!
I am trying packer build --only=qemu --var virtio_win_iso=./virtio-win.iso ./windows_2019_docker.json and it stuck at ==> qemu: Waiting for WinRM to become available...
I used vncviewer and foud the image build vm can't find the boot disk:
image

Any ideas?

Thanks!

@ranamuerta
Copy link

The problem is qemu args and default packer behavior.

when -drive or -device qemu args are passed packer will no longer add it's default options including adding the Win install iso as a drive so it's trying to boot with no win install iso attached.

this is the original looks like

"qemuargs": [
        [
          "-drive",
          "file=windows_2019_docker-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"
        ],
        [
          "-drive",
          "file={{ user `virtio_win_iso` }},media=cdrom,index=3"
        ]
      ],

whould need to be updated to something like this

"qemuargs": [
       [
          "-drive",
          "file=WINDOWS_INSTALL_ISO_PATH.iso,media=cdrom"
        ], 
       [
          "-drive",
          "file=windows_2019_docker-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"
        ],
        [
          "-drive",
          "file={{ user `virtio_win_iso` }},media=cdrom,index=3"
        ]
      ],

here is the verbage from packer

"
Warning: The qemu command line allows extreme flexibility, so beware of conflicting arguments causing failures of your run. For instance adding a "--drive" or "--device" override will mean that none of the default configuration Packer sets will be used. To see the defaults that Packer sets, look in your packer.log file (set PACKER_LOG=1 to get verbose logging) and search for the qemu-system-x86 command. The arguments are all printed for review, and you can use those arguments along with the template engines allowed by qemu-args to set up a working configuration that includes both the Packer defaults and your extra arguments.
"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants