How to fix “network ‘default’ is not active” error in libvirt

01/01/2021

Question: When I am trying to start a guest VM on QEMU/KVM via virt-manager, it fails to start with the error:

"Error starting domain: Requested operation is not valid: network 'default' is not active"

How can I fix this error?

When you install QEMU/KVM in Linux, the default NAT network is created automatically by libvirtd daemon. The properties of the default network are defined in the libvirt‘s default network template (located at /etc/libvirt/qemu/networks/default.xml). This default network is used to interconnect guest VMs’s virtual NICs in NAT mode.

If, for whatever reason, the default network is deactivated, you won’t be able to start any guest VMs which are configured to use the network.

When you check the state of existing networks, you will see inactive state for the default network.

$ sudo virsh net-list --all

Here we show how to solve the default network stuck in inactive state.

Solution One

Your first attempt can be simply trying to start the network with virsh.

$ sudo virsh net-start default

If you encounter the following error, go to the next solution.

internal error: Network is already in use by interface virbr0

Solution Two

Identify the name of the bridge associated with the default network. You can find out the bridge name in the default network template (/etc/libvirt/qemu/networks/default.xml). In most cases, the bridge name is virbr0.

Remove that bridge as follows.

$ sudo ifconfig virbr0 down
$ sudo brctl delbr virbr0

Now start the default network using virsh command.

$ sudo virsh net-start default

This will automatically re-create the virbr0 bridge.

Verify the state of the default network.

$ sudo virsh net-list --all

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

[KVM] Hướng dẫn sử dụng WebVirtCloud

Sau bài cài đặt, mình đã dành vài ngày để thử nghiệm các tính năng và cách sử dụng của WebVirtCloud....
30/12/2020

[KVM][CentOS-7] Hướng dẫn cài đặt KVM trên CentOS-7

KVM (Kernel-based Virtual Machine) được biết đến là một cơ sở hạ tầng ảo hóa cho nhân Linux dành...
30/12/2020

Installing KVM/QEMU on CentOS 8 for Virtualization

In this article, I am going to show you how to install KVM/QEMU on CentOS 8 and how to connect to it remotely using Virtual...
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Mua proxy v4 chạy socks5 để chơi game an toàn, tốc độ cao ở đâu?
18/05/2024

Thuê mua proxy Telegram trọn gói, tốc độ cao, giá siêu hời
18/05/2024

Thuê mua proxy Viettel ở đâu uy tín, chất lượng và giá tốt? 
14/05/2024

Dịch vụ thuê mua proxy US UK uy tín, chất lượng số #1
13/05/2024

Thuê mua proxy Việt Nam: Báo giá & các thông tin MỚI NHẤT
13/05/2024