Skip to content

machines: machine: add support for adding vde-backed network interfaces#47

Merged
hnez merged 6 commits into
forrest-runner:mainfrom
hnez:vde-switch
Jun 25, 2026
Merged

machines: machine: add support for adding vde-backed network interfaces#47
hnez merged 6 commits into
forrest-runner:mainfrom
hnez:vde-switch

Conversation

@hnez

@hnez hnez commented Jun 8, 2026

Copy link
Copy Markdown
Member

This enables us to have specific machines join some network in addition to the "QEMU user networking" based default network.
It relies on vde because that allows us to join networks without e.g. having to do bridge configuration and creating tun/tap devices (as root).

Todo before merging:

  • Decide if the config format sounds reasonable to us.
  • Test the feature.
  • Add documentation on and code comments.

@hnez
hnez force-pushed the vde-switch branch 5 times, most recently from da76952 to 4069cf3 Compare June 10, 2026 08:48
@hnez
hnez requested a review from jluebbe June 10, 2026 08:50
@hnez
hnez marked this pull request as ready for review June 10, 2026 08:50
hnez added 6 commits June 24, 2026 07:50
This enables us to have specific machines join some network in addition to
the "QEMU user networking" based default network.
It relies on vde because that allows us to join networks without e.g.
having to do bridge configuration and creating tun/tap devices (as root).

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
…aces

The virtual machines can no longer share the same MAC address when the are
connected to the same layer 2 network.
Implement random generation of MAC addresses for extra network interfaces.

This does not affect the main network interface, which uses QEMU user
network emulation.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
The MAC addresses we use only have to be unique at that specific point in
time. When assigning a random MAC to every VM we can easily cause
(temporary) exhaustion of available IPv4 addresses from a DHCP server,
since the leases need time to expire.

Reuse MAC addresses so that DHCP servers can give out the same IP to
different VMs (as long as they are not running at the same time).

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Setting up stable rust is easy. Let's not pretend that it is not.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
We now have our first set of tests thanks to the MAC address generation.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
@hnez

hnez commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Hi @jluebbe,

could you have a look at this PR as well? We are currently using it in production on our runner.

@hnez
hnez merged commit f6cbb41 into forrest-runner:main Jun 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant