Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost files on host when canceling limactl start #2221

Closed
dj-documentation opened this issue Feb 20, 2024 · 8 comments · Fixed by #2234 or #2241
Closed

Lost files on host when canceling limactl start #2221

dj-documentation opened this issue Feb 20, 2024 · 8 comments · Fixed by #2234 or #2241

Comments

@dj-documentation
Copy link

dj-documentation commented Feb 20, 2024

Description

Canceling limactl start debug deleted files that were mounted from the host.

I don't have the exact config anymore but it was similar to this. The mounted ~/Files directory was deleted.

images:
  - location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.35/alpine-lima-std-3.19.0-aarch64.iso"
    arch: "aarch64"
    digest: "sha512:13e50601ee65af5d7a6dfd30bb41fd89f8bf806ecdb516c61fe238c3cf3b57cf67469418a99f329bb4c343e3387e6e0fd4fe20501cfd501f031f7244adc67215"

containerd:
  system: false
  user: false
  archives:
    - location: "https://github.com/containerd/nerdctl/releases/download/v2.0.0-beta.0/nerdctl-full-2.0.0-beta.0-linux-arm64.tar.gz"
      arch: "aarch64"
      digest: "sha256:29c58dc39ebca1642f14827915f67d909ec49b1d7458938401cf835edbc5b8d0"

os: "Linux"
arch: "aarch64"
vmType: "vz"
cpus: 2
memory: "2GiB"
disk: "2GiB"

mountType: "virtiofs"
mounts:    
  - location: "~/Files"                                                                                                                      
    mountPoint: "/Files"    
    writable: true  

audio:
  device: "vz"
video:
  display: "none"
networks:
  - vzNAT: true
ssh:
  localPort: 54201
  loadDotSSHPubKeys: false
  forwardAgent: false
  forwardX11: false
  forwardX11Trusted: false
@jandubois
Copy link
Member

jandubois commented Mar 7, 2024

This also happened twice today for @mook-as: all files in the $HOME directory were wiped out when using virtiofs on Linux: openSUSE Leap 15.5 x86_64 VM using the Rust virtiofsd from obs://Virtualization and $HOME was mounted writable.

This was during Rancher Desktop testing and did not involve canceling limactl start afaiu. More details and repro steps in rancher-sandbox/rancher-desktop#6582

@AkihiroSuda
Copy link
Member

This also happened twice today for @mook-as: all files in the $HOME directory were wiped out when using virtiofs on Linux: openSUSE Leap 15.5 x86_64 VM using the Rust virtiofsd from obs://Virtualization and $HOME was mounted writable.

Which version of Lima, QEMU, virtiofsd, host kernel, guest kernel, etc. ? Is this a recent regression? Does this happen with an older release of Lima, etc.?

@jandubois
Copy link
Member

@dj-documentation Do you still remember which version of Lima and macOS you were using?

Was it HEAD of master at the time you submitted the issue (I'm guessing, as your template references nerdctl-v2.0.0-beta.0, but I want to be sure it wasn't an earlier Lima version with just an updated template).

@AkihiroSuda
Copy link
Member

nerdctl-v2.0.0-beta.0

We haven't merged this into Lima master yet

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Mar 7, 2024

openSUSE Leap 15.5 x86_64 VM using the Rust virtiofsd from obs://Virtualization and $HOME was mounted writable.

Tried to follow this, but I couldn't repro the issue.
For me, every write operation to the host home directory just fails with Invalid argument.

Package versions

openSUSE-release-15.5-lp155.286.1.x86_64
kernel-default-5.14.21-150500.55.49.1.x86_64
qemu-8.2.1-Virt.150500.977.2.x86_64
virtiofsd-1.10.1-Virt.150500.22.1.x86_64

Lima: 0.20.1-59-gbbd1d80

YAML:

images:
  - location: "https://cloud-images.ubuntu.com/releases/23.10/release/ubuntu-23.10-server-cloudimg-amd64.img"
mounts:
  - location: "~"
    writable: true
mountType: "virtiofs"
memory: 1GiB
cpuType:
  x86_64: "Haswell-v4"

Host filesystem: btrfs

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Mar 8, 2024

@dj-documentation How does your host home directory look like?
Is it located or synlinked on /home rather than /Users?

ref

@jandubois
Copy link
Member

The host directory doesn't really matter; it depends on the mount point. In @dj-documentation's example it was /Files:

mounts:    
  - location: "~/Files"                                                                                                                      
    mountPoint: "/Files"    
    writable: true  

The current theory would not explain why that would get moved/wiped. Only mount points at the following locations, or possibly subdirectories thereof would be affected:

/etc /home /root /tmp /usr/local /var/lib

@dj-documentation is it possible that your mount point inside the VM was under one of these locations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment