tobimensch / aqemu

Official AQEMU repository - a GUI for virtual machines using QEMU as the backend
https://sourceforge.net/projects/aqemu/
GNU General Public License v2.0
503 stars 88 forks source link

Can't start VM from GUI if -append 'blah blah blah' is used in VM/Advanced/custom QEMU Command LineArguments #41

Open olahaye74 opened 7 years ago

olahaye74 commented 7 years ago

if I try to run a VM from the GUI with custom arguments: -kernel /tmp/vmlinuz-3.10.0-514.2.2.el7.x86_64 -initrd /tmp/initrd.img -append 'SKIP_LOCAL_CFG=y MONITOR_SERVER=172.16.59.250 MONITOR_CONSOLE=yes ramdisk_blocksize=1024 ramdisk_size=128000 acpi=no noapic rdshell rd.shell ip=dhcp dns=1.2.3.4,1.2.3.5 keymap=fr-latin9 ksdevice=bootif lang=fr_FR.UTF-8 repo=http://mirror.centos.org/centos/6/os/x86_64 acpi=no noapic ip=bootif rdnetdebug rd.debug'

It fails with the following error: qemu-system-x86_64: -append SKIP_LOCAL_CFG=y MONITOR_SERVER=172.16.59.250 MONITOR_CONSOLE=yes ramdisk_blocksize=1024 ramdisk_size=128000 acpi=no noapic rdshell rd.shell ip=dhcp dns=1.2.3.4,1.2.3.5 keymap=fr-latin9 ksdevice=bootif lang=fr_FR.UTF-8 repo=http://mirror.centos.org/centos/6/os/x86_64 acpi=no noapic ip=bootif rdnetdebug rd.debug: drive with bus=0, unit=0 (index=0) exists

If I generate the script, it works fine.

The problem is in the $* last argument put at the end of the script. Calling the script with an argument triggers the same error while calling it without argument works, so I assume that aqemu, when starting the VM, will add some arguments that are not a disk image, and the qemu fails.

aqemu version: aqemu-0.9.2-1.fc25.x86_64

Linux_x86_64.aqemu.txt

olahaye74 commented 7 years ago

Apparently, strace gives some tips: [pid 14415] execve("/usr/bin/qemu-system-x86_64", ["/usr/bin/qemu-system-x86_64", "-monitor", "stdio", "-soundhw", "ac97", "-k", "fr", "-machine", "accel=kvm", "-m", "1024", "-no-fd-bootchk", "-hda", "/home/ol222822/vmware/aquemu/disc_1", "-net", "nic,vlan=0,macaddr=00:16:76:43:5b:0a,model=e1000", "-net", "user,vlan=0,hostname=oscarnode", "-rtc", "base=localtime", "-name", "\"Linux x86_64\"", "-kernel", "/tmp/vmlinuz-3.10.0-514.2.2.el7.x86_64", "-initrd", "/tmp/initrd.img", "-append", "'SKIP_LOCAL_CFG=y", "MONITOR_SERVER=172.16.59.250", "MONITOR_CONSOLE=yes", "ramdisk_blocksize=1024", "ramdisk_size=128000", "acpi=no", "noapic", "rdshell", "rd.shell", "ip=dhcp", "dns=132.166.192.7,132.166.192.6", "keymap=fr-latin9", "ksdevice=bootif", "lang=fr_FR.UTF-8", "repo=http://mirror.centos.org/centos/6/os/x86_64", "acpi=no", "noapic", "ip=bootif", "rdnetdebug", "rd.debug'", "/home/ol222822/vmware/aquemu/disc_1"], [/ 78 vars /] <unfinished ...>

the -append 'blah blah bah' is split while it shouldn't! (simple quotes (also tested with double quotes) are ignored).

Knowing that, the $* at the end of the generated script is another issue that has nothing to do with this issue.