0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ubuntu20.04のlibvirtdで--listenできない

Last updated at Posted at 2020-11-26

KVMを使って仮想化しようと思い、libvirtdを設定した際、いつも通り /etc/default/libvirtdlibvirtd_opts="-l"にしてリスタートしたところ、

libvirtd[3872]: --listen parameter not permitted with systemd activation sockets, see 'man libvirtd' for further guidance
systemd[1]: libvirtd.service: Main process exited, code=exited, status=6/NOTCONFIGURED
systemd[1]: libvirtd.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Virtualization daemon.
systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 2.
systemd[1]: Stopped Virtualization daemon.

と吐いて上手く起動できない。

メッセージの通り、 man libvirtdして確認したところ、

OPTIONS
...
       -l, --listen

       Listen for TCP/IP connections. This should not be set if using systemd socket activation. Instead activate the libvirtd-tls.socket or libvirtd-tcp.socket unit files.
...

との事。

libvirtdのバージョン5からは -lは使えませんので、 libvirtd-tcp.socket使ってね。という事らしい。
しかも、libvirtd.serviceが起動する前に起動させないとならないので、 /lib/systemd/system/libvirtd.serviceを編集

[Unit]
...
Wants=libvirtd-tcp.socket ←追記
...

適用します。

# systemctl daemon-reload

libvirtd-tcp.socketの自動起動を有効にします。

# systemctl enable libvirtd-tcp.socket

念のため、システムを再起動させます。

無事にtcp16509をlistenしている事が確認できました。
※PIDが1/initでちょっとキモイ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?