Skip to content

Error setting VM mapped volumes #67

Open

Description

@kholisrag

got below error when running on

  • Macbook Pro M3 Pro
  • macOS Sequioa 15.5 (24F74)
❯ krunvm start ubuntu /bin/bash
Error setting VM mapped volumes
❯ krunvm start ubuntu
Error setting VM mapped volumes

Image

Activity

  1. walteh commented on May 25, 2025

    @walteh

    I have the same problem on my M1 Max, same macOS version - krunvm --version 0.2.3

  2. stephen-fox commented on Jun 8, 2025

    @stephen-fox
    Contributor

    It looks like support for mapped volumes was dropped in libkrun by this commit in February 2024: libkrun/libkrun@186083d

    That commit mentions using "multiple virtio-fs devices" instead. It appears krunvm still calls the deprecated function unconditionally, so it always fails even if the user does not configure any mapped volumes:

    In krunvm:

    #[cfg(target_os = "macos")]
    fn map_volumes(ctx: u32, vmcfg: &VmConfig, rootfs: &str) {
        let mut volumes = Vec::new();
        for (host_path, guest_path) in vmcfg.mapped_volumes.iter() {
            // ...
        }
    
        // ...
    
        let ret = unsafe { bindings::krun_set_mapped_volumes(ctx, vols.as_ptr()) };
        if ret < 0 {
            println!("Error setting VM mapped volumes");
            std::process::exit(-1);
        }
    }

    ... and in libkrun

    pub unsafe extern "C" fn krun_set_mapped_volumes(
        _ctx_id: u32,
        _c_mapped_volumes: *const *const c_char,
    ) -> i32 {
        -libc::EINVAL
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions