[howto] Insert USB2Ethernet adapter to libvirt node

Karina
1 min readMay 26, 2020

--

Assume you created VM under libvirt and want to pass to this VM USB2Ethernet adapter inserted to your host. From your host you need these three files for insert and remove USB device and xml file with it’s definition:

When you inserted USB via ./insert_usb.sh you will see it in your VM via lsusb for example. Just a reminder of how to login to it:

sudo virsh console your_vm_name

But when you check it out via ifconfig, you may notice that it can’t get IP address or got the one that is not in your network. The most easiest way is to make IP static.

Create /etc/systemd/network/my_adapter.network file at your VM. Filename must end with .network. Possible content:

[Match]
Name=enp0s1*
Name=eth*
[Network]
Address=192.168.1.242/24

Restart network service (wiki):

systemctl restart systemd-networkd

Got it. See you.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Karina
Karina

Written by Karina

I’m not a programmer, I’m just pretending https://github.com/keyrnk

No responses yet

Write a response