qemus / qemu-docker

QEMU in a Docker container.
MIT License
318 stars 35 forks source link

[Question]: tutorial for *.img.gz #552

Open EinFreierUser opened 3 weeks ago

EinFreierUser commented 3 weeks ago

Is your question not already answered in the FAQ?

Is this a general question and not a technical issue?

Question

Hello, i like the idea of the qemu in a docker. But its different for a beginner like me compared to the native qemu. My goal is to run things like Libre Elec in it (images like img.gz, that arent .iso). I get it running in the native qemu by converting it into qcow2, but in your version it starts booting only to a certain point and then gets stuck. Perhaps u can add a few steps and cli-commands in your description, how to get such an image running?

Thank you and keep up the great work

kroese commented 3 weeks ago

Thanks. The container is more based on the assumption that you have a CD-ROM ISO to install from, instead of a pre-made disk IMG.

However, it should be possible by extracting the *.img.gz to a file called data.img which you place in the /storage folder, and then making the BOOT variable empty.

That way it should work, but if you have a download link to the file, I can see if I can make this process easier (automatic).

EinFreierUser commented 3 weeks ago

Thanks, I will give it a try.

That would be even easier. The link for this example is https://releases.libreelec.tv/LibreELEC-Generic.x86_64-12.0.0.img.gz

kroese commented 3 weeks ago

@EinFreierUser I created a new version (v5.15) now, that supports images like *.img.gz now, and if I set:

environment: 
  BOOT: "https://releases.libreelec.tv/LibreELEC-Generic.x86_64-12.0.0.img.gz"

it seems to work fine. Please try it out!

EinFreierUser commented 3 weeks ago

hey, i downloaded the new version and typed

docker run -it --rm -e "BOOT="https://releases.libreelec.tv/LibreELEC-Generic.x86_64-12.0.0.img.gz -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN qemux/qemu-docker

and it started up! Only Problem is that it cant install because of a missing hdd... i read ur advice to change it into blk when this problem comes up... but im stuck at looking for the right command... compose is sadly no option for me... is there a list with the commands i can use?

kroese commented 3 weeks ago

-e "DISK_TYPE=ide"

EinFreierUser commented 3 weeks ago

right code, but dont solve the problem... with qemu it worked with

qemu-system-x86_64 -enable-kvm -cpu host -machine q35 -device amd-iommu -m 4096 -smp 4 -device virtio-vga-gl -display sdl,gl=on -device intel-hda -device hda-duplex -device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -hda /home/x/vmplatten/LibreELEC-Generic.x86_64-12.0.0.qcow2 -name "LibElec"

i dont unterstand the whole lines and its copied somewhere and modified a little bit for this, but it runs... if i need all the parameters, i dont know, but if it is starting up, i will see how it will perform :D

kroese commented 3 weeks ago

@EinFreierUser Ow nevermind, the reason was very simple.

When booting via a .qcow2 it replaces the hard disk that it normally creates when booting via cd-rom. My assumption was that as you already have a harddrive (the .qcow2 file) you dont need a second one.

But with the LibreElec file it is not a ready-installed OS, but an installer. So you need to add a second harddrive even though you already have one.

I created a new version (v5.16) which fixes this, please try it out.

EinFreierUser commented 3 weeks ago

hey, the v5.16 works like a charm, many thanks. The disk is found. Its still not booting up completely, but i think, there is something different missing like 3D accelleration or similar. I'll try to solve it with compose... is there a list with the whole commands to make a bash script (*.sh)? seems not to be equal to the original qemu commands

kroese commented 3 weeks ago

If you set -e "DEBUG=Y" it will print out the generated QEMU commandline. If you set -e "ARGUMENTS=" you can add extra commands to that line.