canonical / canonical/multipass

`multipass mount` w/ ID mapping creates unwritable mountpoints when the source path contains spaces

Open
#1,693 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
9.2k
Forks
829
Avg merge
3d 2h
Merged PRs (30d)
45

Description

To Reproduce

  1. cd ~
  2. mkdir 'path with spaces'
  3. multipass launch --name multipass-mount-problem xenial
  4. multipass exec multipass-mount-problem -- mkdir /home/ubuntu/mountpoint
  5. multipass mount --verbose --uid-map "$(id --user)":1000 --gid-map "$(id --group)":1000 'path with spaces' multipass-mount-problem:/home/ubuntu/mountpoint

Expected behavior

  • Mount operation completed without errors
  • Mountpoint is accessible in VM

Current behavior

  • Apparmor related errors: console output.log
  • Unable to write into the mountpoint in VM:
    ubuntu@multipass-mount-problem:~$ cp /etc/fstab mountpoint/
    cp: cannot create regular file 'mountpoint/fstab': Operation not permitted
    

Logs

snap.multipass_star_ journald logs.log

Additional info

  • OS: Ubuntu 20.04 amd64
  • multipass version
    multipass  1.4.0
    multipassd 1.4.0
    
  • multipass info --all
    Name:           multipass-mount-problem
    State:          Running
    IPv4:           10.55.22.247
    Release:        Ubuntu 16.04.7 LTS
    Image hash:     ac5c214712c4 (Ubuntu 16.04 LTS)
    Load:           0.00 0.02 0.00
    Disk usage:     937.7M out of 4.8G
    Memory usage:   61.6M out of 992.0M
    Mounts:         /home/brlin/path with spaces => /home/ubuntu/mountpoint
                        UID map: 12345:1000
                        GID map: 12345:1000
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the listed reproduction commands with a source directory containing spaces and the shown UID/GID mappings. Read the linked console and journald logs while comparing the mount behavior with a path without spaces. Done means the mount completes without AppArmor-related errors and the VM can write to the mountpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.