How to fix the read only error on lima vm
Asked Answered
S

4

9

Getting read only file system error when try to create local repository for docker. [1] I used this installed lima [2] over Macbook Air M1 (Apple chipset)

chown: changing ownership of 'oracle-19c/.DS_Store': Read-only file system
chown: changing ownership of 'oracle-19c/oradata': Read-only file system
chown: changing ownership of 'oracle-19c/': Read-only file system

Any one know how to resolve this. I have change the permission to read write with 'getInfor' option by selecting the relevant folder.

[1] https://registry.hub.docker.com/r/doctorkirk/oracle-19c [2] https://github.com/lima-vm/lima

Sheep answered 23/3, 2022 at 2:36 Comment(0)
T
11

By default the home is read only. You may try write on /tmp/lima, this should work.

To make home and other paths writeable by default, do the following:

  1. Edit the file and set writable: true under mount section

    $ vim ~/.lima/default/lima.yaml
    
  2. Then restart lima

    limactl list #this lists all running vms 
    limactl stop default #or name of the machine 
    limactl start default #or name of the machine 
    

Further infos: https://github.com/lima-vm/lima/blob/41fd9cc6a1e2bac73666e1f2b11604c7c42227dc/pkg/limayaml/default.TEMPLATE.yaml#L33-L41

Trisyllable answered 9/6, 2022 at 11:58 Comment(1)
Thanks for a helpful answer and for including a link to the documentation. For clarity, I suggest you edit your point 1 to change from write: true to writable: true. This will be more consistent with the documentation, and the change that people need to make.Aorta
L
2

As @Dunick answered, We should add a writable feature to lima.yaml for each mounted volumes

 - location: "~"
 writable: true
 - location: "/tmp/lima"
 writable: true
Laminous answered 17/2, 2023 at 9:10 Comment(0)
C
1

In my case, using macOS Sonoma, and if you want to do it faster, but a bit insecure:

# Bash or zsh
limactl edit your-instance-name --mount-writable
Cart answered 7/2 at 6:45 Comment(0)
H
0

To be able to write to your home directory, you need to grant lima write permissions to your home directory.

vi ~/.lima/<your-vm-name>/lima.yml

and change

mounts:
  - location: "~"
  - location: "/tmp/lima"
    writable: true

to

mounts:
  - location: "~"
    writeable: true
  - location: "/tmp/lima"
    writable: true
Hephzibah answered 12/4 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.