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've created a KVM VM using virt-install. There is an image file in the directory /ssd/kvms.

How do I access the virtual machine and turn it on? Do I need to assign an IP address, and if so, how do I do that?

share|improve this question

3 Answers 3

What distro are you using? Debian? Centos? Arch? Ubuntu? Suse?

I can recommend http://virt-manager.org/ (older versions can be found in your package manager at your distribution of linux) Very good tutorial can be found here: http://virt-tools.org/learning/start-install-with-virt-manager/

All basic operations with KVM can very easily be done with virt-manager. It is easy, fast and quiet safe for newbies.

All others possibilities how to control KVM can be found here: linux-kvm.org/page/Management_Tools

But i tried some of them and did not working.

share|improve this answer

If you used virt-install, you're using libvirt, and you can use virt-manager to manage and view the VM.

share|improve this answer
    
Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager.py", line 383, in <module> main() File "/usr/share/virt-manager/virt-manager.py", line 286, in main raise gtk_error RuntimeError: could not open display –  Richard Nov 16 '12 at 23:41
    
I got the above error after installing virt-manager using yum and starting it. Is there any way to access SSH of the VM without using virt-manager? Must I assign it an IP?> –  Richard Nov 16 '12 at 23:42
    
For your first question, you need an X display (e.g. ssh -X to your server) to run virt-manager. For the second question, yes, SSH uses the network and so you need an IP address. –  Jim Paris Nov 17 '12 at 21:11

If it's for the same architecture, you can start it with something like

kvm -cpu host -m 1024 -hda /ssd/kvms/my-image.bin

Options

-cpu host

means use same CPU as host machine

-m 1024

use 1GB main memory

-hda /ssd/kvms/my-image.bin

this image is my first hard disk

There are many more options listed in man kvm.

share|improve this answer

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.