2

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?

2

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.

1

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

  • 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 – user3180 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?> – user3180 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
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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