Guilherme Santos
2011-May-06 14:39 UTC
[libvirt-users] Objective: run commands in the domain. Trouble: setting up a console
I've installed libvirt and also Virtual Box OSE hypervisor, in order to see if I could properly manage it through virsh. I could easily set up, start, pause, resume, shutdown and destroy the newly created domains, from a XML file. Then I was wondering how could I be able to spawn commands in the domain through virsh, and the command 'console' gave me a the thought that I should connect to the domain's console, so that, once connected, I would be able to "do anything". Am I right? I need to be able to run commands in the virtual machine. If the only way is by accessing the domain's console, how can I properly set up one? I tried several ways, following the examples in the documentation. Problem is that no matter what I wrote in the xml file about serial or console devices, it aways get overriden by null configuration when I start the domain (I can see it by using command 'edit' <domain> ). So then I tried to edit the XML through virsh and insert specifications about console or serial devices, but I never was able to sucessfully edit the file. I always got the same error message: "could not define a domain, rc=80bb0004", although the domain is in fact defined! I tried editing the XML both with the domain running and stopped. My final alternative was using command 'attach-device' passing a xml containing only the specifications of serial or console devices. I aways received an error message saying that memory limit was exceeded, although I strongly suppose that's not the real problem. I am sure that I am configuring something (or many things) wrongly, so that I am getting all those errors... My initial problem is just to be able to run commands in the newly created domain. Anybody can tell me an easier way to do this? If setting up consoles is the only way, what is going on wrongly for me? Sorry if an answer for this issue is already somewhere in the documentation, I tried to find it hard before emailing you guys! Thanks anyway!! -- Guilherme Santos G. Baptista Graduando em Ci?ncia da Computa??o pela UFCG LSD - Laborat?rio de Sistemas Distribu?dos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20110506/2acee1ed/attachment.htm>
Osier Yang
2011-May-09 06:41 UTC
[libvirt-users] Objective: run commands in the domain. Trouble: setting up a console
? 2011?05?06? 22:39, Guilherme Santos ??:> I've installed libvirt and also Virtual Box OSE hypervisor, in order to > see if I could properly manage it through virsh. > I could easily set up, start, pause, resume, shutdown and destroy the > newly created domains, from a XML file. > > Then I was wondering how could I be able to spawn commands in the domain > through virsh, and the command 'console' gave me a the thought that I > should connect to the domain's console, so that, once connected, I would > be able to "do anything". Am I right? > > I need to be able to run commands in the virtual machine. If the only > way is by accessing the domain's console, how can I properly set up one? > I tried several ways, following the examples in the documentation. > > Problem is that no matter what I wrote in the xml file about serial or > console devices, it aways get overriden by null configuration when I > start the domain (I can see it by using command 'edit' <domain> ). > > So then I tried to edit the XML through virsh and insert specifications > about console or serial devices, but I never was able to sucessfully > edit the file. I always got the same error message: "could not define a > domain, rc=80bb0004", although the domain is in fact defined! I tried > editing the XML both with the domain running and stopped. > > My final alternative was using command 'attach-device' passing a xml > containing only the specifications of serial or console devices. I aways > received an error message saying that memory limit was exceeded, > although I strongly suppose that's not the real problem.If it says "no memory", it's bug.> > I am sure that I am configuring something (or many things) wrongly, so > that I am getting all those errors... My initial problem is just to be > able to run commands in the newly created domain. Anybody can tell me an > easier way to do this? If setting up consoles is the only way, what is > going on wrongly for me?You need to configure your guest kernel command line. E.g. Append following to your guest kernel command line. console=ttyS0,115200 For more how to connect to linux via serial console, search web, :) Then something like following in domain xml: <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console> Hope you can connect to the domain via console then by: # virsh console domain> > Sorry if an answer for this issue is already somewhere in the > documentation, I tried to find it hard before emailing you guys! > > Thanks anyway!! > > -- > Guilherme Santos G. Baptista > Graduando em Ci?ncia da Computa??o pela UFCG > LSD - Laborat?rio de Sistemas Distribu?dos > > > > _______________________________________________ > libvirt-users mailing list > libvirt-users at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users