Skip to content

Commit

Permalink
Skip using resolvconf
Browse files Browse the repository at this point in the history
On systems with systemd-resolved installed, dhcpcd tries
to use resolvconf to configure the dns server. Naturally this
fails, as we do not have systemd &co inside the vm.

Signed-off-by: Sasha Finkelstein <[email protected]>
  • Loading branch information
WhatAmISupposedToPutHere committed Sep 1, 2024
1 parent 54bd66e commit bff63b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/krun-guest/src/bin/krun-guest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::cmp;
use std::os::unix::process::CommandExt as _;
use std::process::Command;

use anyhow::{Context, Result};
use krun_guest::cli_options::options;
use krun_guest::fex::setup_fex;
Expand Down Expand Up @@ -39,6 +38,8 @@ fn main() -> Result<()> {
return Err(err).context("Failed to mount filesystems, bailing out");
}
Command::new("/usr/lib/systemd/systemd-udevd").spawn()?;
Command::new("/usr/bin/udevadm").arg("trigger").spawn()?.wait()?;
Command::new("/usr/bin/udevadm").arg("settle").spawn()?.wait()?;

setup_fex()?;

Expand Down
2 changes: 1 addition & 1 deletion crates/krun-guest/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn configure_network() -> Result<()> {
};
if let Some(dhcpcd_path) = dhcpcd_path {
let output = Command::new(dhcpcd_path)
.args(["-M", "--nodev", "eth0"])
.args(["-M", "eth0", "-e", "resolvconf=does-not-exist"])
.output()
.context("Failed to execute `dhcpcd` as child process")?;
debug!(output:?; "dhcpcd output");
Expand Down

0 comments on commit bff63b4

Please sign in to comment.