Ask Your Question
0

KVM: blank VM (without OS)

asked 2013-02-14 13:41:23 -0500

Rhino gravatar image

I need to create blank virtual machine. Set HDD, RAM and other "hardware" configuration without installation operating system (as in VirtualBox). Do you have any hint how I can do it? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-14 15:58:46 -0500

The IceMan Blog gravatar image

you can use the define option to import a VM xml file let say you have a xml file like this (copy 'n' pase to XML file)

<domain type='kvm'>
  <name>test-vm</name>
  <uuid>81d8cd1c-cbca-6691-5ba2-dfd27ce72346</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg-storage/tempvm'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
</domain>

then run on the shell

virsh define filename.xml

then you can edit/manage the machine with 'Virtual Machine Manager'

the other way is to use virt-install with the --import switch i think

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-14 13:41:23 -0500

Seen: 436 times

Last updated: Feb 14 '13