0

I'm testing the creation of virtual machines with Ubuntu. The first virtual machine was created with the default settings and is called ubuntu:

virsh --connect qemu:///system list --all
 Id    Name                           State
----------------------------------------------------
 -     ubuntu                         shut off

I'm creating an additional virtual machine:

vmbuilder kvm ubuntu \
--suite saucy \
    --flavour virtual \
    --user demo \
    --pass demo \
    --arch amd64 \
    --dest /var/vm/demo1 \
    --part vmbuilder.partition \
    --domain demo1 \
    --ip 192.168.1.3 \
    --mask 255.255.255.0 \
    --gw 192.168.1.1 \
    --dns 192.168.1.2 \
    --libvirt qemu:///system \
    --addpkg linux-image-generic \
    --addpkg openssh-server

The command fails with the following error:

Domain ubuntu already exists at qemu:///system

Why is it sticking with ubuntu? Isn't it the purpose of --domain to set the name of the domain?

2 Answers2

0

The error talks about a domain, but it's actually the host name which is already in use.

The --domain option sets the domain to which the VM belongs, not the actual name of the machine. To set the name of the machine, use --hostname option (found in vmbuilder kvm ubuntu --help).

0

I faced the same issue. Each VM will have a subdirectory called ubuntu-kvm

I overcame this issue by creating a new directory for each VM.

you have to create e.g. /var/lib/libvirt/images/vm1, /var/lib/libvirt/images/vm2, and so on.

Each VM will have a subdirectory called ubuntu-kvm, and there can be just one such directory in /var/lib/libvirt/images/vm1.

If you try to create a second VM in /var/lib/libvirt/images/vm1, you will get an error message saying ubuntu-kvm already exists.