Skip to content

Commit

Permalink
Merge pull request #33 from containers/auth
Browse files Browse the repository at this point in the history
Suppress virsh "Authorization not available." warnings
  • Loading branch information
albertofaria authored Mar 15, 2024
2 parents dac14ae + f34eb45 commit 29b5508
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/commands/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,19 @@ fn set_up_extra_container_mounts_and_devices(spec: &mut oci_spec::runtime::Spec)
add_bind_mount(spec, path);
}

// If virsh runs with a tty and finds an executable at /usr/bin/pkttyagent, it will attempt to
// run it even if polkit auth is disabled, resulting in "Authorization not available. Check if
// polkit service is running or see debug message for more information." messages.
spec.mounts_push(
oci_spec::runtime::MountBuilder::default()
.typ("bind")
.source("/dev/null")
.destination("/usr/bin/pkttyagent")
.options(["bind".to_string(), "rprivate".to_string(), "ro".to_string()])
.build()
.unwrap(),
);

add_bind_mount(spec, "/dev/kvm");
add_char_dev(spec, "/dev/kvm")?;

Expand Down

0 comments on commit 29b5508

Please sign in to comment.