Skip to content

Commit

Permalink
explain the error of missing vhost_vsock kmod
Browse files Browse the repository at this point in the history
On some servers the vhost_vsock kernel mod is not loaded automatically,
and the containers launcher stops with OS error 99. This change makes
the error message easier to read.

Change-Id: Ib9376fa8b14dc7be2d7071dae97515a455a7023c
  • Loading branch information
dingelish committed Jun 13, 2024
1 parent 2cc66aa commit d34d074
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oak_containers_launcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ impl Launcher {
let orchestrator_sockaddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0);
let listener = TcpListener::bind(sockaddr).await?;
let port = listener.local_addr()?.port();
// Resuse the same port we got for the TCP socket for vsock.
let vsock_listener = VsockListener::bind(VsockAddr::new(VMADDR_CID_HOST, port.into()))?;
// Reuse the same port we got for the TCP socket for vsock.
let vsock_listener = VsockListener::bind(VsockAddr::new(VMADDR_CID_HOST, port.into()))
.expect("Bind failed. Check if kernel mod vhost_vsock is loaded. Try running `sudo modprobe vhost_vsock` to load it.");
log::info!("Launcher service listening on port {port}");
let (evidence_sender, evidence_receiver) = oneshot::channel::<Evidence>();
let (shutdown_sender, mut shutdown_receiver) = watch::channel::<()>(());
Expand Down

0 comments on commit d34d074

Please sign in to comment.