quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.74k stars 470 forks source link

Ubuntu VM from Tutorial does not start #943

Closed marcusdots closed 6 months ago

marcusdots commented 8 months ago

Expected behaviour

I am on Debian. I tried to follow the tutorial in README.md and install an Ubuntu VM.

Actual behaviour

Ubuntu VM does not start.

Steps to reproduce the behaviour

$ time ./quickget ubuntu 22.04
ubuntu-22.04/ubuntu-22.04.3-deskto 100%[================================================================>]   4.69G  11.0MB/s    in 7m 34s  
Checking ubuntu-22.04/ubuntu-22.04.3-desktop-amd64.iso with sha256sum... Good!
Making ubuntu-22.04.conf
Giving user execute permissions on ubuntu-22.04.conf,

To start your Ubuntu virtual machine run:
    quickemu --vm ubuntu-22.04.conf

sys     0m35.121s

$ ./quickemu --vm ubuntu-22.04.conf
Quickemu 4.9.1 using /usr/bin/qemu-system-x86_64 v7.2.9
 - Host:     Debian GNU/Linux 12 (bookworm) running Linux 6.1 (gaia)
 - CPU:       AMD Ryzen 7 7840U w/ Radeon780M Graphics
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 16G RAM
 - BOOT:     EFI (Linux), OVMF (/usr/share/OVMF/OVMF_CODE.fd), SecureBoot (off).
 - Disk:     ubuntu-22.04/disk.qcow2 (16G)
             Just created, booting from ubuntu-22.04/ubuntu-22.04.3-desktop-amd64.iso
 - Boot ISO: ubuntu-22.04/ubuntu-22.04.3-desktop-amd64.iso
 - Display:  SDL, virtio-vga-gl, GL (on), VirGL (on)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-betadots ~/Public
 - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "ubuntu-22.04/ubuntu-22.04-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:ubuntu-22.04/ubuntu-22.04-monitor.socket
 - Serial:   On host:  nc -U "ubuntu-22.04/ubuntu-22.04-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:ubuntu-22.04/ubuntu-22.04-serial.socket
audio: Could not init `pa' audio driver
cat: ubuntu-22.04/ubuntu-22.04.pid: No such file or directory
 - Process:  Starting ubuntu-22.04.conf as ubuntu-22.04 ()

$ ssh user@localhost -p 22220
ssh: connect to host localhost port 22220: Connection refused

Linux Distribution & Kernel

$ lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

$ uname -a
Linux xyz 6.1.0-15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.66-1 (2023-12-09) x86_64 GNU/Linux
TuxVinyards commented 8 months ago

@flexiondotorg

I think we probably need an FAQ in the readme for this type of "issue" Along with all the other similar issues.

Something in the issue template too:

We need to remind people to check all the closed issues, not just the open ones.

Plus something to tell users not to instantly presume there is something wrong with quickemu when their first install fails to work. Something to tell them to test their Host setup is up-to-date and to test it in various scenarios too.

Edit: Something like this, that I have just added https://github.com/TuxVinyards/qqX/wiki/FAQs-and-Help

marcusdots commented 8 months ago

I think your target audience are qemu novices. At least that is what draw me to quickemu. qemu is powerful but hard to learn and I was hoping that the quickemu abstraction would provide an easy start.

That being said, I think a KISS VM to verify your host system would help new users.

In my case quickemu was trying to setup pulseaudio and failed. I think a stripped down VM with as least as possible assumptions about the host system would ease debugging issues.

My fix is ubuntu-22.04.sh

#!/usr/bin/env bash
/usr/bin/qemu-system-x86_64 \
    -name ubuntu-22.04,process=ubuntu-22.04 \
    -pidfile ubuntu-22.04/ubuntu-22.04.pid \
    -enable-kvm \
    -machine q35,smm=off,vmport=off \
    -cpu host,kvm=on,topoext \
    -smp cores=4,threads=2,sockets=1 \
    -m 16G \
    -device virtio-balloon \
    -vga none \
    -device virtio-vga-gl,xres=1152,yres=648 \
    -display sdl,gl=on \
    -device intel-hda \
    -rtc base=localtime,clock=host,driftfix=slew \
    -device virtio-rng-pci,rng=rng0 \
    -object rng-random,id=rng0,filename=/dev/urandom \
    -device qemu-xhci,id=spicepass \
    -chardev spicevmc,id=usbredirchardev1,name=usbredir \
    -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
    -chardev spicevmc,id=usbredirchardev2,name=usbredir \
    -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
    -chardev spicevmc,id=usbredirchardev3,name=usbredir \
    -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 \
    -device pci-ohci,id=smartpass \
    -device usb-ccid \
    -chardev spicevmc,id=ccid,name=smartcard \
    -device ccid-card-passthru,chardev=ccid \
    -device usb-ehci,id=input \
    -device usb-kbd,bus=input.0 \
    -k en-us \
    -device usb-tablet,bus=input.0 \
    -device virtio-net,netdev=nic \
    -netdev user,hostname=ubuntu-22.04,hostfwd=tcp::22220-:22,id=nic \
    -global driver=cfi.pflash01,property=secure,value=on \
    -drive if=pflash,format=raw,unit=0,file=/usr/share/OVMF/OVMF_CODE.fd,readonly=on \
    -drive if=pflash,format=raw,unit=1,file=ubuntu-22.04/OVMF_VARS.fd \
    -drive media=cdrom,index=0,file=ubuntu-22.04/ubuntu-22.04.3-desktop-amd64.iso \
    -device virtio-blk-pci,drive=SystemDisk \
    -drive id=SystemDisk,if=none,format=qcow2,file=ubuntu-22.04/disk.qcow2 \
    -fsdev local,id=fsdev0,path=/home/betadots/Public,security_model=mapped-xattr \
    -device virtio-9p-pci,fsdev=fsdev0,mount_tag=Public-betadots \
    -monitor unix:ubuntu-22.04/ubuntu-22.04-monitor.socket,server,nowait \
    -serial unix:ubuntu-22.04/ubuntu-22.04-serial.socket,server,nowait

# #    -audiodev pa,id=audio0 \
#     -device hda-duplex,audiodev=audio0 \
TuxVinyards commented 8 months ago

:+1:

Try this: https://github.com/TuxVinyards/qqX/wiki/Custom-Qemu-boot-parameters