Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
05-16-2020, 03:51 PM
#1
Member
Registered: Aug 2010
Posts: 96
Rep:
Convert libvirt xml into qemu command line
Hello,
I created a VM using virt-manager and I can edit that xml using virsh edit, but I would like to ask you if there is way of converting libvirt xml into qemu command line. I've found that someone else made the same question sime time ago :
https://www.reddit.com/r/VFIO/commen...mand_line_and/
and the user jkhsjdhjs says :
For converting libvirt xml to qemu command line you can just start the vm with libvirt. libvirt will start a qemu process with a whole lot of command line arguments which you can then save. Since libvirt just starts a qemu process they should perform exactly the same.
ok,but how ? I would like to understand how to start the vm with libvirt,so that I can see every options included in the qemu command.
I tried with :
Code:
virsh dumpxml win10
virsh domxml-to-native qemu-argv win10.xml
error: internal error: invalid PCI passthrough type 'default'
I used this command :
Code:
/usr/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-win10-2/master-key.aes -machine pc-i440fx-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-vendor-id=ab1234567890,kvm=off -m 16000 -overcommit mem-lock=off -smp 14,maxcpus=196,sockets=14,cores=7,threads=2 -uuid a3b8bd1a-3e0e-4e64-8f46-78d901d904cb -no-user-config -nodefaults -chardev socket,id=charmonitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x5 -device lsi,id=scsi0,bus=pci.0,addr=0x10 -device ahci,id=sata0,bus=pci.0,addr=0x6 -device ahci,id=sata1,bus=pci.0,addr=0xf -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xe -device ide-cd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0 -device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,write-cache=on -netdev tap,fd=34,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:e4:59:85,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=3 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device intel-hda,id=sound1,bus=pci.0,addr=0xd -device hda-duplex,id=sound1-codec0,bus=sound1.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=4 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,addr=0x7 -device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x8 -device vfio-pci,host=0000:01:00.2,id=hostdev2,bus=pci.0,addr=0x9 -device vfio-pci,host=0000:01:00.3,id=hostdev3,bus=pci.0,addr=0xa -device vfio-pci,host=0000:00:12.0,id=hostdev4,bus=pci.0,addr=0xb -device usb-host,hostbus=1,hostaddr=8,id=hostdev5,bus=usb.0,port=1 -device usb-host,hostbus=1,hostaddr=6,id=hostdev6,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
it is not enough good for me. I'm not able to boot the vm using these arguments.without libvirt.
05-17-2020, 09:04 AM
#2
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
Code:
virsh start win10
ps -ef | grep qemu
Here you are, your command line.
05-18-2020, 04:50 AM
#3
Member
Registered: Aug 2010
Posts: 96
Original Poster
Rep:
thanks,but it gives me something like this :
Quote:
/usr/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-win10/master-key.aes -blockdev {"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"} -blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win10_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"} -machine pc-i440fx-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-vendor-id=ab1234567890,kvm=off -m 16000 -overcommit mem-lock=off -smp 14,maxcpus=196,sockets=14,cores=7,threads=2 -uuid a3b8bd1a-3e0e-4e64-8f46-78d901d904cb -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x5 -device lsi,id=scsi0,bus=pci.0,addr=0x10 -device ahci,id=sata0,bus=pci.0,addr=0x6 -device ahci,id=sata1,bus=pci.0,addr=0xf -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xe -blockdev {"driver":"file","filename":"/home/ziomario/Scrivania/TooLinux/Pass/ISO/virtio-win.iso","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-3-format","read-only":true,"driver":"raw","file":"libvirt-3-storage"} -device ide-cd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0 -blockdev {"driver":"host_device","filename":"/dev/sda","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"} -device ide-hd,bus=sata0.0,drive=libvirt-2-format,id=sata0-0-0,bootindex=1,write-cache=on -blockdev {"driver":"host_device","filename":"/dev/sdb","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"} -device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,write-cache=on -netdev tap,fd=34,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:e4:59:85,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=3 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=p ci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device intel-hda,id=sound1,bus=pci.0,addr=0xd -device hda-duplex,id=sound1-codec0,bus=sound1.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=4 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,addr=0x7 -device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x8 -device vfio-pci,host=0000:01:00.2,id=hostdev2,bus=pci.0,addr=0x9 -device vfio-pci,host=0000:01:00.3,id=hostdev3,bus=pci.0,addr=0xa -device vfio-pci,host=0000:00:12.0,id=hostdev4,bus=pci.0,addr=0xb -device usb-host,hostbus=1,hostaddr=8,id=hostdev5,bus=usb.0,port=1 -device usb-host,hostbus=1,hostaddr=6,id=hostdev6,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
as u can see,these arguments should be clean or they will not work. Infact,if I run it as is,it gives to me the following error :
-chardev socket,id=charmonitor,server,nowait: Exactly one of 'path', 'fd' or 'host' required
it should be fixed. I'm not able to do that. it is too complicated for me. Isn't a method that gives a cleaner result ?
05-18-2020, 06:04 AM
#4
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
Personally, I don't know enough about qemu command-line options to explain or correct the error.
05-18-2020, 06:20 AM
#5
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
Strangely, I see the following in the output:
Code:
-chardev socket,id=charmonitor,fd=32,server,nowait
but the error message omits the "fd=32" part.
05-18-2020, 11:43 AM
#6
Member
Registered: Aug 2010
Posts: 96
Original Poster
Rep:
ok this is the output. I think that previously I had attempt to remove some parts :
Code:
/usr/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-win10/master-key.aes -blockdev {"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"} -blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win10_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"} -machine pc-i440fx-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-vendor-id=ab1234567890,kvm=off -m 16000 -overcommit mem-lock=off -smp 14,maxcpus=196,sockets=14,cores=7,threads=2 -uuid a3b8bd1a-3e0e-4e64-8f46-78d901d904cb -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x5 -device lsi,id=scsi0,bus=pci.0,addr=0x10 -device ahci,id=sata0,bus=pci.0,addr=0x6 -device ahci,id=sata1,bus=pci.0,addr=0xf -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xe -blockdev {"driver":"file","filename":"/home/ziomario/Scrivania/TooLinux/Pass/ISO/virtio-win.iso","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-3-format","read-only":true,"driver":"raw","file":"libvirt-3-storage"} -device ide-cd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0 -blockdev {"driver":"host_device","filename":"/dev/sda","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"} -device ide-hd,bus=sata0.0,drive=libvirt-2-format,id=sata0-0-0,bootindex=1,write-cache=on -blockdev {"driver":"host_device","filename":"/dev/sdb","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"} -device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,write-cache=on -netdev tap,fd=34,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:e4:59:85,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=3 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device intel-hda,id=sound1,bus=pci.0,addr=0xd -device hda-duplex,id=sound1-codec0,bus=sound1.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=4 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,addr=0x7 -device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x8 -device vfio-pci,host=0000:01:00.2,id=hostdev2,bus=pci.0,addr=0x9 -device vfio-pci,host=0000:01:00.3,id=hostdev3,bus=pci.0,addr=0xa -device vfio-pci,host=0000:00:12.0,id=hostdev4,bus=pci.0,addr=0xb -device usb-host,hostbus=1,hostaddr=8,id=hostdev5,bus=usb.0,port=1 -device usb-host,hostbus=1,hostaddr=6,id=hostdev6,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
so,this is what happens if I try to run all of these commands in a sh file directly :
root@ziomario-Z390-AORUS-PRO:/home/ziomario/Scrivania/TooLinux# ./win_virt.sh
Code:
qemu-system-x86_64: -blockdev driver:file: Invalid parameter 'driver:file'
05-18-2020, 12:02 PM
#7
Senior Member
Registered: Mar 2020
Posts: 3,670
Rep:
^This is because you aren't quoting the argument to
-blockdev , so braces ({}) get interpreted by bash and expanded.
Code:
... -blockdev ' {"driver":"file",..."discard":"unmap"}' ...
1 members found this post helpful.
05-18-2020, 04:34 PM
#8
LQ Newbie
Registered: May 2020
Posts: 23
Rep:
I don't understand what should I do to have a full and working qemu commands.
05-18-2020, 06:33 PM
#9
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
Add single quotes to escape the braces and double quotes, like shruggy showed you. You can also use backslashes.
This is not a qemu problem, but a shell problem.
Last edited by berndbausch; 05-18-2020 at 06:35 PM .
05-22-2020, 05:22 AM
#10
Member
Registered: Aug 2010
Posts: 96
Original Poster
Rep:
I've added quotes and I have remvoed the argument "-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-win10/master-key.aes" because I haven't any master-key.aes file on my computer. This is the command that I have got :
Quote:
/usr/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on -S -blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' -blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win10_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' -machine pc-i440fx-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-vendor-id=ab1234567890,kvm=off -m 16000 -overcommit mem-lock=off -smp 14,maxcpus=196,sockets=14,cores=7,threads=2 -uuid a3b8bd1a-3e0e-4e64-8f46-78d901d904cb -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x5 -device lsi,id=scsi0,bus=pci.0,addr=0x10 -device ahci,id=sata0,bus=pci.0,addr=0x6 -device ahci,id=sata1,bus=pci.0,addr=0xf -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xe -blockdev '{"driver":"file","filename":"/home/ziomario/Scrivania/TooLinux/Pass/ISO/virtio-win.iso","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw","file":"libvirt-3-storage"}' -device ide-cd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0 -blockdev '{"driver":"host_device","filename":"/dev/sda","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' -device ide-hd,bus=sata0.0,drive=libvirt-2-format,id=sata0-0-0,bootindex=1,write-cache=on -blockdev '{"driver":"host_device","filename":"/dev/sdb","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' -device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,write-cache=on -netdev tap,fd=34,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:e4:59:85,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=3 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=p ci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device intel-hda,id=sound1,bus=pci.0,addr=0xd -device hda-duplex,id=sound1-codec0,bus=sound1.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=4 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,addr=0x7 -device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x8 -device vfio-pci,host=0000:01:00.2,id=hostdev2,bus=pci.0,addr=0x9 -device vfio-pci,host=0000:01:00.3,id=hostdev3,bus=pci.0,addr=0xa -device vfio-pci,host=0000:00:12.0,id=hostdev4,bus=pci.0,addr=0xb -device usb-host,hostbus=1,hostaddr=8,id=hostdev5,bus=usb.0,port=1 -device usb-host,hostbus=1,hostaddr=6,id=hostdev6,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
but it produced this error :
qemu-system-x86_64: -chardev socket,id=charmonitor,fd=32,server,nowait: File descriptor '32' is not a socket
Last edited by marietto; 05-22-2020 at 05:25 AM .
05-22-2020, 05:31 AM
#11
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
My guess: By removing "-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-win10/master-key.aes ", you changed the file descriptor numbering. Perhaps try 31? Or leave that option in?
I do wonder, though. You say yourself that you don't know qemu well, and you don't seem to know shell syntax that well either. Why do you insist on composing a qemu command line of that degree of complexity? Why not just use the XML file and launch the VM with virt-manager or virsh?
05-23-2020, 04:54 AM
#12
Member
Registered: Aug 2010
Posts: 96
Original Poster
Rep:
if I don't have any master-key.aes file,If I leave that option there,it will give the error : "file not found". I like to chain commands more than using virt-manager or virsh,because its easier to experiment. u know,removing and adding arguments is easier because they are all there,in a unique place. just a glance to see them all.
Last edited by marietto; 05-23-2020 at 04:56 AM .
05-23-2020, 05:34 AM
#13
LQ Addict
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316
Perhaps you can remove the chardev option as well.
05-24-2020, 05:06 AM
#14
LQ Newbie
Registered: May 2020
Posts: 23
Rep:
I have removed all the chardev lines. This chain of commands :
Quote:
/usr/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on -S -blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' -blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win10_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' -machine pc-i440fx-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-vendor-id=ab1234567890,kvm=off -m 16000 -overcommit mem-lock=off -smp 14,maxcpus=196,sockets=14,cores=7,threads=2 -uuid a3b8bd1a-3e0e-4e64-8f46-78d901d904cb -no-user-config -nodefaults -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x5 -device lsi,id=scsi0,bus=pci.0,addr=0x10 -device ahci,id=sata0,bus=pci.0,addr=0x6 -device ahci,id=sata1,bus=pci.0,addr=0xf -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xe -blockdev '{"driver":"file","filename":"/home/ziomario/Scrivania/TooLinux/Pass/ISO/virtio-win.iso","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw","file":"libvirt-3-storage"}' -device ide-cd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0 -blockdev '{"driver":"host_device","filename":"/dev/sda","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' -device ide-hd,bus=sata0.0,drive=libvirt-2-format,id=sata0-0-0,bootindex=1,write-cache=on -blockdev '{"driver":"host_device","filename":"/dev/sdb","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' -device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,write-cache=on -netdev tap,fd=34,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:e4:59:85,bus=pci.0,addr=0x3 -device isa-serial -device virtserialport,bus=virtio-serial0.0,nr=1 -device usb-tablet,id=input0,bus=usb.0,port=3 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=p ci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device intel-hda,id=sound1,bus=pci.0,addr=0xd -device hda-duplex,id=sound1-codec0,bus=sound1.0,cad=0 -device usb-redir -device usb-redir -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,addr=0x7 -device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x8 -device vfio-pci,host=0000:01:00.2,id=hostdev2,bus=pci.0,addr=0x9 -device vfio-pci,host=0000:01:00.3,id=hostdev3,bus=pci.0,addr=0xa -device vfio-pci,host=0000:00:12.0,id=hostdev4,bus=pci.0,addr=0xb -device usb-host,hostbus=1,hostaddr=8,id=hostdev5,bus=usb.0,port=1 -device usb-host,hostbus=1,hostaddr=6,id=hostdev6,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
gives this error :
Quote:
qemu-system-x86_64: /build/qemu-7aKH5L/qemu-4.2/util/oslib-posix.c:247: qemu_set_nonblock: Assertion `f != -1' failed.
07-04-2020, 09:10 AM
#15
LQ Newbie
Registered: May 2020
Posts: 23
Rep:
this problem is still unfixed. someone wants to help me further ? thanks.
All times are GMT -5. The time now is 11:29 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News