quickemu-project / quickemu

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

feat: add a small collection of requested features and fixes #1199

Closed flexiondotorg closed 2 months ago

philclifford commented 2 months ago
 quickemu --vm alpine-latest.conf --monitor-cmd quit
qemu-img: Could not open 'alpine-latest/disk.qcow2': Failed to get shared "write" lock
Is another process using the image [alpine-latest/disk.qcow2]?
VM already started!
Processing line: ssh,22220
 - Sending:  quit

we send the monitor command now, and quit works OK

I think maybe an apt update has been though, because now system_powerdown does nothing (system_reset works still)

popey commented 2 months ago
    elif [ -e "${disk_img}" ]; then
        # Check there isn't already a process attached to the disk image.
        if ! ${QEMU_IMG} info "${disk_img}" >/dev/null; then
            echo "             Failed to get \"write\" lock. Is another process using the disk?"
            exit 1

This looks like the culprit for this:

./quickemu --vm ./ubuntu-24.04.conf --kill                                                                                
qemu-img: Could not open 'ubuntu-24.04/disk.qcow2': Failed to get shared "write" lock                                                                                                         
Is another process using the image [ubuntu-24.04/disk.qcow2]?                                                                                                                                 
VM already started!                                                                                                                                                                           
Killing ubuntu-24.04                                                                                                                                                                          
 - ubuntu-24.04 (1539308) killed.                                           

Agreed offline works though :+1: Good on the resolution output too!

flexiondotorg commented 2 months ago

@philclifford and @popey Thanks for the feedback, there was quite a few logic bombs in there. Please test this branch again and let me know how it goes.