Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
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.


  Search this Thread
Old 10-03-2012, 07:56 PM   #1
Registered: Apr 2007
Location: the Rocket City
Distribution: Debian, Ubuntu, CentOS; in days past Fedora, Solaris, SunOS, 4.2BSD, 4.3BSD, SVR4, AIX, HP-UX
Posts: 101

Rep: Reputation: Disabled
libvirt qemu/kvm on Debian Squeeze; serial port causes error in VM startup

I require access to a host serial port (/dev/ttyS0) on a virtual machine. I have installed VMs with virt-install and virt-manager and encountered the same (or at least very similar) problems in each case. The current discussion assumes virt-manager.

The host machine is Debian 6.0.6, the VM is Ubuntu server 12.04, virt-manager is version 0.8.4, libvirtd is version 0.8.3, and the hypervisor is KVM (qemu:///system).

Upon creation of the VM and installation of Ubuntu, the VM starts and works fine. If I create a serial port with virt-manager->Edit->Virtual Machine Details->Add Hardware (Device Type: dev, Source Path: /dev/ttyS0) and restart the VM, I get an error

Error starting domain: internal error Process exited while reading console log output: char device redirected to /dev/pts/2
chardev: opening backend "tty" failed
Before I added this serial port, the VM started without error. If I add the serial port, I get the error. If I use virt-manager to remove the serial port, the VM starts without error.

On the host, /dev/ttyS0 is owned by root, the group is dialout, and the permissions are 660. libvirt-qemu is a member of dialout.

If I change the permissions of /dev/ttS0 to 666, the VM starts up without complaint. I don't quite know why this is true, I assume libvirtd runs as root because I ran virt-install with sudo. Even if that reasoning is false, the libvirt-qemu user being a member of dialout group should work. However, I don't know which user libvirtd really runs as for qemu:///system. Is it root or libvirt-qemu or me or something else?

I have done some searching on this forum and haven't found an answer. Google searches find similar problems that are blamed on AppArmor or SELinux, but I am using neither. The online documentation seems sparse, and I have not found a solution at

My questions are:
1) How can the VM get access to the host's /dev/ttyS0?
2) Why does changing permissions of /dev/ttyS0 to 666 allow the VM to start with out an error related to tty? Whose permissions is the VM running with, and in which group?
3) I assume that I am making an obvious mistake, so the real question is: what obvious mistake am I making ?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
LXer: Qemu-kvm 0.15.1 & Spice(0.10.0) & Libvirt 0.9.7-2 USB Redirection support for Ubuntu Precise a LXer Syndicated Linux News 0 11-14-2011 11:30 AM
libvirt/kvm: Enter passphrase during guest startup using virsh start <domain> druuna Linux - Virtualization and Cloud 0 09-29-2011 06:59 AM
Debian Squeeze port 80 assignment at startup EMateer Debian 11 08-02-2011 07:58 PM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration