Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a KVM session running on my host. If I login as someone else on my host machine, is it possible to access that running KVM session (not through the network)?

I am not using the virtual manager either - I started the machine with the kvm command.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

After doing more research, I discovered I was executing the VM wrong. The proper way to do so would be to use the virsh utility. After starting a vm that way (with start vm-name), you can use the virt-viewer to view the running VM.

I hope this helps someone else trying to learn about KVM!

share|improve this answer
add comment

The method of accessing the console of a VM you started manually with the kvm command would depend on which arguments you used. By default, KVM will try to use SDL to display the VGA output. This limits output to only the current logged in user (X session, basically).

A better way to do it is to add -vnc :0 to your arguments. This will tell KVM to redirect the VGA display over a VNC session on the standard VNC port of 5900 (for other ports, see below). You can then access the console with any VNC viewer; tell it to use hostname localhost and port 5900.

To use a different VNC port, just do -vnc :1 for port 5901, -vnc :2 for port 5902, and so on...

virsh does all this for you behind the scenes. In fact virt-viewer is simply a minimal VNC client.

share|improve this answer
add comment

You can access vm by use spice, vnc or rdp etc.. All access methods need to assign a port. You can use 127.0.0.1:port to access the vm. This will not use the network for real.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.