qemu error : Failed to create chardev

Issues related to applications and software problems
YDE
Posts: 3
Joined: 2014/08/23 16:42:43

qemu error : Failed to create chardev

Postby YDE » 2014/08/23 16:50:31

Hi

I have a dedicated server with Centos7. I installed qemu-kvm and libvirtd to create vms.
But when I want to create a vm I still have the same error, either with virt-install or virt-manager.

Code: Select all

virt-install --name server --ram 768 --vcpus 2 --disk path=/var/lib/libvirt/images/server.img,size=20 --location /home/centos.iso

Début d'installation...
Récupération du fichier .treeinfo...                          | 1.9 kB  00:00:00     
Récupération du fichier vmlinuz...                            | 9.4 MB  00:00:00     
Récupération du fichier initrd.img...                         |  67 MB  00:00:00     
ERROR    internal error: process exited while connecting to monitor: qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev

L'installation du domaine ne semble pas s'être terminée avec succès.
Si c'est bon, vous pouvez démarrer le domaine en lançant :
 virsh --connect qemu:///system start server
sinon, recommencez l'installation.


Logs file :

2014-08-23 15:48:25.666+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name server -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 768 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 4bf3fe03-1d8a-4344-8d6e-2cd67715776c -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/server.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot -boot strict=on -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.kub87U -initrd /var/lib/libvirt/boot/virtinst-initrd.img.DqNSML -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/server.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/home/centos.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:38:46:3c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev
2014-08-23 15:48:25.878+0000: shutting down


SELinux is in permissive.
Someone have an idea ?
Thanks

User avatar
KeiKun
Posts: 1
Joined: 2014/08/24 15:05:41

Re: qemu error : Failed to create chardev

Postby KeiKun » 2014/08/24 15:07:56

same here

Code: Select all

[root@Core-Server ~]$ virt-install \
> --os-variant debianwheezy \
> --network bridge=br0 \
> --disk path=/var/lib/libvirt/images/vm1.img,size=10 \
> --cdrom=/root/debian-7.6.0-i386-netinst.iso \
> --graphics vnc \
> --vcpus 2 \
> --ram=1024 \
> --name=vm1 \
> --hvm \
> --noautoconsole

Starting install...
Allocating 'vm1.img'                                                                                                                             |  10 GB  00:00:00
ERROR    internal error: process exited while connecting to monitor: qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev

Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start vm1
otherwise, please restart your installation.


Log:

Code: Select all

Aug 24 22:03:48 localhost systemd[1]: Started Virtualization daemon.
Aug 24 22:03:48 localhost libvirtd[10752]: libvirt version: 1.1.1, package: 29.el7_0.1 (CentOS BuildSystem <http://bugs.centos.org>, 2014-07-22-19:38:59, worker1.bsys.centos.org)
Aug 24 22:03:48 localhost libvirtd[10752]: Unable to lookup SELinux process context: Invalid argument
Aug 24 22:03:48 localhost dnsmasq[976]: read /etc/hosts - 9 addresses
Aug 24 22:03:48 localhost dnsmasq[976]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Aug 24 22:03:48 localhost dnsmasq-dhcp[976]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Aug 24 22:03:57 localhost libvirtd[10752]: failed to connect to monitor socket: No such process
Aug 24 22:03:57 localhost libvirtd[10752]: internal error: process exited while connecting to monitor: qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev
Aug 24 22:03:57 localhost libvirtd[10752]: Unable to lookup SELinux process context: Invalid argument
Aug 24 22:06:24 localhost systemd[1]: Started Virtualization daemon.

Arlion
Posts: 9
Joined: 2013/05/18 22:42:07

Re: qemu error : Failed to create chardev

Postby Arlion » 2014/08/25 17:59:24

Good Afternoon,

Seems to be very common.

Here is my post on the issue, no response as of yet.

https://www.centos.org/forums/viewtopic ... 48&t=48073

YDE
Posts: 3
Joined: 2014/08/23 16:42:43

Re: qemu error : Failed to create chardev

Postby YDE » 2014/08/26 10:31:41

I installed all packages for Virtualization and new errors appears :

Code: Select all

yum groupinstall "Virtualization" "Virtualization Host" "Virtualization Tools" "Virtualization Platform" "Virtualization Client"

systemctl restart libvirtd
 


After a virt-install try :

Code: Select all

systemctl status libvirtd

août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: User record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: Group record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: User record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: Group record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: User record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: Group record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: User record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: Group record for user '107' was not found: No such file or directory
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: failed to connect to monitor socket: No such process
août 25 20:47:53 ns504738.ip-142-4-208.net libvirtd[3483]: internal error: process exited while connecting to monitor: qemu-kvm: -chardev pty,id=charserial0: Faile...e chardev


Code: Select all

grep 107 /etc/{group,passwd}
/etc/group:qemu:x:107:
/etc/passwd:qemu:x:107:107:qemu user:/:/sbin/nologin

codebauss
Posts: 5
Joined: 2014/08/26 21:23:02

Re: qemu error : Failed to create chardev

Postby codebauss » 2014/08/26 21:26:26

Hey YDE,

The issue with the user/group is more than likely because of /etc/nsswitch.conf check to see if passwd, group, and shadow are files sssd. If they are, remove the sssd from there and those errors should disappear; this worked for me.

I am getting the chardev error as well however I have not been able to find a fix. I opted to just go with minimal install of Fedora 20 as I do not have licensing for RHEL7.

Kind regards,

codebauss

YDE
Posts: 3
Joined: 2014/08/23 16:42:43

Re: qemu error : Failed to create chardev

Postby YDE » 2014/08/27 14:49:59

same on Fedora 20


Code: Select all

yum -y install libvirt qemu-kvm virt-manager virt-install
systemctl start libvirtd
virt-install --name server --noautoconsole --ram 768 --location http://isoredirect.centos.org/centos-7/7.0.1406/os/x86_64 --disk path=/var/lib/libvirt/images/server.qcow2,size=20

Début d'installation...
Récupération du fichier .treeinfo...                                                                                                                   | 2.2 kB  00:00:00 !!!
Récupération du fichier vmlinuz...                                                                                                                     | 9.4 MB  00:00:01 !!!
Récupération du fichier initrd.img...                                                                                                                  |  67 MB  00:00:03 !!!
ERROR    internal error: process exited while connecting to monitor: Failed to create chardev


Code: Select all

systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since mer. 2014-08-27 10:46:14 EDT; 12s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 1091 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─ 571 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
           └─1091 /usr/sbin/libvirtd

août 27 10:46:14 ns504738.ip-142-4-208.net systemd[1]: Starting Virtualization daemon...
août 27 10:46:14 ns504738.ip-142-4-208.net systemd[1]: Started Virtualization daemon.
août 27 10:46:14 ns504738.ip-142-4-208.net dnsmasq[571]: read /etc/hosts - 9 addresses
août 27 10:46:14 ns504738.ip-142-4-208.net dnsmasq[571]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
août 27 10:46:14 ns504738.ip-142-4-208.net dnsmasq-dhcp[571]: read /var/lib/libvirt/dnsmasq/default.hostsfile
août 27 10:46:14 ns504738.ip-142-4-208.net libvirtd[1091]: libvirt version: 1.1.3.5, package: 2.fc20 (Fedora Project, 2014-05-19-22:55:50, buildvm-04.phx2.fedoraproject.org)
août 27 10:46:14 ns504738.ip-142-4-208.net libvirtd[1091]: Failed to open file '/proc/xen/capabilities': No such file or directory
août 27 10:46:24 ns504738.ip-142-4-208.net libvirtd[1091]: failed to connect to monitor socket: No such process
août 27 10:46:24 ns504738.ip-142-4-208.net libvirtd[1091]: internal error: process exited while connecting to monitor: Failed to create chardev


It works fine on Centos6, I'll stay on for now...

codebauss
Posts: 5
Joined: 2014/08/26 21:23:02

Re: qemu error : Failed to create chardev

Postby codebauss » 2014/09/08 14:03:21

So, the issue is with the creation/non-creation of serial device as one may deduce from the error message. Based on a bug report I posted regarding this, one person said to use virt-manager and when creating the guest to select custom and then select Serial Device and set it to null. There is a drop-down menu that allows you do so. This method does in fact work however the issue is that I do not know how to do this via the cli and do not want to use the gui so hopefully this helps with getting it resolved. Below is a successful build's xml file via the gui:

<domain type='kvm'>
<name>chardev</name>
<uuid>ae80c992-a757-43ae-9e5a-59d5f9d7f14a</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/lib/libvirt/images/chardev.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:ea:ba:66'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='null'>
<target port='0'/>
</serial>
<console type='null'>
<target type='serial' port='0'/>
</console>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='spice' autoport='yes'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
</devices>
</domain>

codebauss
Posts: 5
Joined: 2014/08/26 21:23:02

Re: qemu error : Failed to create chardev

Postby codebauss » 2014/09/19 11:08:39

Good news! I figured it out I believe. Modify your /etc/fstab and then restart your server:

vi /etc/fstab

You will/should see a line starting with devpts. Copy the line just in case something goes wrong and comment out the original. Modify the copied line to look like this:

devpts /dev/pts devpts gid=5,mode=620 0 0

Comment back letting us know if it works. Worked for me!

Previously guest log showed:
2014-09-08 08:46:03.988+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin /usr/libexec/qemu-kvm -name websrv1 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=
1 -uuid 3b80618b-4ce5-413b-bc34-f3b773a85de2 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/websrv1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot -boot strict=on -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.ZnAYt_ -initrd /var/lib/libvirt/boot/virtinst-initrd.img.92jTwK -append console=ttyS0 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/websrv1.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/root/c7min.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=28,id=hostnet0,vhost=on,vhostfd=29 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:88:f1:66,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
qemu-kvm: -chardev pty,id=charserial0: Failed to create chardev

Now:
2014-09-19 10:43:04.238+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin /usr/libexec/qemu-kvm -name websrv1 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid e5d20a8e-34ca-4b43-917f-02ce3fdd7434 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/websrv1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot -boot strict=on -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.rBi0TD -initrd /var/lib/libvirt/boot/virtinst-initrd.img.lOsjFG -append console=ttyS0 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/websrv1.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/var/lib/libvirt/images/c7min.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ca:48:89,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
char device redirected to /dev/pts/1 (label charserial0)

[root@server ~]# virt-install -n websrv1 -r 1024 --nographics --location /var/lib/libvirt/images/c7min.iso --disk path=/var/lib/libvirt/images/websrv1.img,size=8 -x "console=ttyS0"

Starting install...
Retrieving file .treeinfo... | 1.9 kB 00:00:00
Retrieving file vmlinuz... | 9.4 MB 00:00:00
Retrieving file initrd.img... | 67 MB 00:00:00
Creating domain... | 0 B 00:00:00
Connected to domain websrv1
Escape character is ^]
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.10.0-123.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) 0000001 SMP Mon Jun 30 12:09:22 UTC 2014
[ 0.000000] Command line: console=ttyS0
[ 0.000000] e820: BIOS-provided physical RAM map:
...
...
...
Installing iwl3945-firmware (292/292)
Performing post-installation setup tasks
Performing post-installation setup tasks
.
Installing bootloader
.

Configuring installed system
.
Writing network configuration
.
Creating users
.
Configuring addons
.
Generating initramfs
.
Running post-installation scripts
.
Use of this product is subject to the license agreement found at /usr/share/centos-release/EULA

Installation complete. Press return to quit
[anaconda] 1:main* 2:shell 3:log 4:storage-log 5:program-log

dext
Posts: 2
Joined: 2013/10/30 10:46:13

Re: qemu error : Failed to create chardev

Postby dext » 2014/10/09 15:41:03

codebauss wrote:devpts /dev/pts devpts gid=5,mode=620 0 0


Thank you! I lost like 2 days trying to fix this problem. Your solution works perfect. I owe you a beer :)