quickemu-project / quickemu

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

`Invalid argument` for new `qcow2` drive #30

Closed mmartinortiz closed 3 years ago

mmartinortiz commented 4 years ago

Sorry if the title is not very descriptive. With a fresh downloaded focal image, I run the script like ./quickemu --vm focal.conf from the directory with the cloned project on a Ubuntu 18.04 machine. I've tried both with the beta of 20.04 and KDE Neon, in both cases I get the same error.

focal.conf file:

boot="legacy"
guest_os="linux"
iso="/home/$USER/Quickemu/focal/focal-desktop-amd64.iso"
disk_img="/home/$USER/Quickemu/focal/focal-amd64.qcow2"
ram=8G
disk=40G

Output

Starting focal.conf
 - QEMU:     /snap/bin/qemu-virgil v4.2.0
 - BOOT:     Legacy BIOS
 - Guest:    Linux optimised
 - Disk:     /home/user/Quickemu/focal/focal-amd64.qcow2 (40G)
             Looks unused, booting from /home/user/Quickemu/focal/focal-desktop-amd64.iso
 - Boot:     /home/user/Quickemu/focal/focal-desktop-amd64.iso
 - CPU:      4 Core(s)
 - RAM:      8G
 - Screen:   1664x936
 - Video:    virtio-vga
 - GL:       ON
 - Virgil3D: ON
 - Display:  SDL
 - smbd:     /home/user will be exported to the guest via smb://10.0.2.4/qemu
 - ssh:      22220/tcp is connected. Login via 'ssh user@localhost -p 22220'
qemu-system-x86_64: -drive if=none,id=drive0,cache=directsync,aio=native,format=qcow2,file=/home/user/Quickemu/focal/focal-amd64.qcow2: file system may not support O_DIRECT
qemu-system-x86_64: -drive if=none,id=drive0,cache=directsync,aio=native,format=qcow2,file=/home/user/Quickemu/focal/focal-amd64.qcow2: Could not open '/home/user/Quickemu/focal/focal-amd64.qcow2': Invalid argument

I've checked the permissions and user can read and write both files.

mifix commented 4 years ago

What file system are you using? zfs?

mmartinortiz commented 4 years ago

What file system are you using? zfs?

No, ext4 on a fully encrypted drive (with LUKS)

flexiondotorg commented 3 years ago

Fixed via https://github.com/wimpysworld/quickemu/commit/418c63354625da2c0637b4ce32541feba24454cc

sergiuszm commented 3 years ago

@flexiondotorg Doesn't cache=none breaks compatibility with ext4 filesystem with journaling enabled? I am not able to setup windows 10 anymore:

quickemu --vm windows-10.conf
Quickemu 2.2.2 starting windows-10.conf
 - QEMU:     /usr/bin/qemu-system-x86_64 v6.0.0
 - BOOT:     EFI (windows)
 - CPU:      1 Socket(s), 2 Core(s), 2 Thread(s), 2G RAM
 - Disk:     windows-10/disk.qcow2 (64G)
             Looks unused, booting from windows-10/Win10_21H1_EnglishInternational_x64.iso
 - Boot ISO: windows-10/Win10_21H1_EnglishInternational_x64.iso
 - CD-ROM:   windows-10/virtio-win.iso
 - Screen:   1152x648
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - ssh:      On host:  ssh user@localhost -p 22221
 - SPICE:    On host:  spicy --title "windows-10" --port 5933 --spice-shared-dir /home/serchio/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - Process:  On guest: killall windows-10   (if a forced kill is required)

qemu-system-x86_64: -drive id=SystemDisk,if=none,format=qcow2,file=windows-10/disk.qcow2,cache=none,aio=native: Could not open 'windows-10/disk.qcow2': filesystem does not support O_DIRECT