[libvirt] How to connect to the running VM

Zdenek Styblik stybla at turnovfree.net
Fri Jul 29 16:27:14 UTC 2011


On 07/29/11 17:32, bala suru wrote:
> Hi,
> Thanks for the information i'll try this ..
> 
> How to  create a kvm image  from  machine which already has the kvm setup
> and  virt-manager ..?
> 
> So far I was using the images created for KVM for the VM .. now I want to
> create a kvm image my self from iso image ...
> 
> 
> regards
> Bala

You're welcome.

As for images, use % virsh; and 'vol-create-as', or % qemu-img; command.
% virsh -c qemu:///system ; and ' virsh # help vol-create-as ;' for
details about this command.

There is also % qemu-img;, however do not do things behind libvirt's
back or it will backfire on you.

I highly recommend to use either some cli tool/scripts eg. for VM
definition or virt-manager or some other GUI tool. It makes your life
easier and things go faster(and sometimes smoother).

http://www.linux-kvm.org/page/Management_Tools

Regards,
Z.

> On Fri, Jul 29, 2011 at 7:06 AM, Zdenek Styblik <stybla at turnovfree.net>wrote:
> 
>> On 07/29/11 13:36, bala suru wrote:
>>> Hi,
>>> I have deployed some VM on to the KVM-qemu and installed libvirtd ..
>>>
>>> I could see the VM running by command virsh list .
>>>
>>> but how to login to the VMs other than SSH ..? i tried virsh vncdisplay ,
>>> but no output ..
>>>
>>> regards
>>> bala
>>>
>>>
>>>
>>>
>>> --
>>> libvir-list mailing list
>>> libvir-list at redhat.com
>>> https://www.redhat.com/mailman/listinfo/libvir-list
>>
>> Hello,
>>
>> if VM is running at localhost eg. your workstation, I do:
>>
>> % netstat -nlp;
>>
>> look for '127.0.0.1:590x' as libvirt assigns VNC ports automatically and
>> in incremental order. (Note: this, however, is not a rule. And you can
>> assign whatever port you want by hand.)
>>
>> ~~~ SNIP ~~~
>> tcp        0      0 localhost:5901          *:*
>> LISTEN      -
>> ~~~ SNIP ~~~
>>
>> Then I just use VNC client like % vncviewer localhost:5901; to connect
>> to VM.
>>
>> Have you tried to hit a key or move the mouse? Console/screen might be
>> in suspend mode in order to "save" power.
>>
>> Also, there might be few catches which depend on your setup.
>> 1] are you sure VM has VNC console assigned? Use % virsh; and 'dumpxml
>> <domain>' command to check out.
>>
>> ~~~ SNIP ~~~
>> <graphics type='vnc' port='5901' autoport='yes'/>
>> ~~~ SNIP ~~~
>>
>> 2] it might be password protected, TLS might be required etc. etc.
>>
>> If it's at remote host, I recommend to use SSH to tunnel VNC port. You
>> can find how-to at internet.
>> You can also use 'virt-manager' which is included as package in many
>> distributions. Well, at least in Fedora, Debian and, I believe, Ubuntu.
>>
>> I hope lines above help you a bit.
>>
>> Regards,
>> Zdenek
>>
>> --
>> Zdenek Styblik
>> email: stybla at turnovfree.net
>> jabber: stybla at jabber.turnovfree.net
>>
> 


-- 
Zdenek Styblik
email: stybla at turnovfree.net
jabber: stybla at jabber.turnovfree.net




More information about the libvir-list mailing list