I have a need for a Windows 7 VM. Trying to install the .ISO with LXD fails

I have a genuine Windows 7 Ultimate .ISO that I’ve renamed to just win7.iso
I have downloaded the latest Virtio .ISO and renamed it to just virtio.iso

The Windows 7 Ultimate .ISO doesn’t have “virtio” so I executed the following command and got an error. Note: win7 is the LXD VM name

$ echo -n ‘-drive file=/home/bmullan/Downloads/win7-genuine/win7.iso,index=0,media=cdrom,if=ide -drive file=/home/bmullan/Downloads/win7-genuine/virtio.iso,index=1,media=cdrom,if=ide’ | lxc config set win7 raw.qemu
Error: cannot set ‘win7’ to ‘raw.qemu’: unknown key

is the following command incorrect?

lxc config set win7 raw.qemu

Thanks for any info

Hmm, the error you’re getting is consistent with the instance being a container instead of a VM.
Did you maybe forgot a --vm when creating the empty instance>

No I used the following command to create the VM

lxc init win7 --empty --vm -c security.secureboot=false -c limits.cpu=4 -c limits.memory=8GB

But I can delete and recreate in case something else occurred.

Brian

Stephane…

Okay same thing happens when I try to recreate:

$ lxc init win7-new --empty --vm -c security.secureboot=false -c limits.cpu=4 -c limits.memory=8GB
Creating win7-new

$ lxc config device override win7-new root size=40GB
Device root overridden for win7-new

$ echo -n ‘-drive file=/home/bmullan/Downloads/win7-genuine/win7.iso,index=0,media=cdrom,if=ide -drive file=/home/bmullan/Downloads/win7-genuine/virtio.iso,index=1,media=cdrom,if=ide’ | lxc config set win7 raw.qemu

Error: cannot set ‘win7’ to ‘raw.qemu’: unknown key

Is the following command syntax incorrect?

lxc config set win7 raw.qemu

From Documentation:
Instance Configuration

It just says:

Oh, you’re missing a -

Should be:

echo -n ‘-drive file=/home/bmullan/Downloads/win7-genuine/win7.iso,index=0,media=cdrom,if=ide -drive file=/home/bmullan/Downloads/win7-genuine/virtio.iso,index=1,media=cdrom,if=ide’ | lxc config set win7 raw.qemu -
1 Like

Thanks … the missing end “-” was the problem.

I did find that other options exist also such as:

lxc config set win7 raw.qemu --  "-device intel-hda -device hda-duplex"