1

I'm trying to use virt-install to easily set up a vm. Silly me.

The endgame here is to have roughly ten of these bad boys running that all have to be able to communicate with one another via ssh, http, various types of databases, etc. So, they MUST be networked, and also, since I'm using ansible to automate the setup for all the different services each one needs, each vm MUST be reachable via ssh on a static IP (also, though the ssh port doesn't have to be 22, it must be the same for every vm, because ssh_port is a global setting in ansible; it can't be different for different hosts) and, finally, it needs to be done without graphics or shutting down the host's ssh daemon. I'm doing the setup on a remote, headless server that I can only access via ssh and does not run an X11 server.

I'd love it if someone could help me start a VM that would meet these requirements, but honestly I'd settle for just getting the damn thing started. I'm attempting to start up a single vm like this:

OS="--os-type linux --os-variant centos7.0" Net="--network bridge:virbr0" Disk="./traffic_ops_db_primary.img,size=10" Location="--location 'http://mirror.i3d.net/pub/centos/7/os/x86_64/'" Cpu="--vcpus=4" Ram="--ram=2048" Name="--name traffic_ops_db_primary" Extra="--extra-args console=ttyS0" sudo virt-install $OS $Net $Disk $Location $Cpu $Ram $Name $Extra

As suggested by multiple online guides and stackoverflow answers. However, I can't find a single other person who has this process fail with the error:

WARNING  Graphics requested but DISPLAY is not set. Not running virt-viewer.
WARNING  No console to launch for the guest, defaulting to --wait -1

Starting install...
Retrieving file vlinuz...
Retrieving file initrd.img...
ERROR    error from service: ListActivatableNames: Connection is closed
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start traffic_ops_db_primary
otherwise, please restart your installation.

What's truly infuriating about this is that it doesn't fail if I don't run it as root (but I can't expose it to the network without root permissions). Here's the output of ip addr show virbr0:

7: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 52:54:00:39:77:0d brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever

So it exists and it's up. I've tried other network devices too, which give either this error or <device name> port vnet0 does not exist, which I'm told means the device doesn't exist (which is bullshit because it's the device I use to connect via ssh to the machine). If for some reason it's impossible to use the virbr0 device, that'd be fine with me, because ideally the machine would be assigned a static IP on the "main" interface, so I can ssh in directly from my personal computer.

TL;DR: virt-install is throwing the error ListActivatableNames: Connection is closed for the default virtual bridge, and googling just that service name turns up literally zero results. What do?

EDIT: I meant to include this, but forgot: the output of sudo virsh net-list --all:

 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
  • I experienced this when I had a stuck VM that I was attempting to force migrate, which had failed. I purged the VM that failed the migration and I was able to create a new VM without issue. Hope this helps. – Jordan Aug 16 '18 at 0:39
  • 1
    UPDATE: I also got this error when libvirtd wasn't running. So... "systemctl restart libvirtd" – Jordan Jan 11 at 18:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.