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

Hypervisor's file system is read-only on 17.12.0-ce-mac46 (21698) #2389

Closed
anfernee-cyanoly opened this issue Jan 10, 2018 · 10 comments

Comments

@anfernee-cyanoly
Copy link

commented Jan 10, 2018

Expected behavior

With previous release, I'm able to change the size of swap space by running below command
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty dd if=/dev/zero of=/var/swap.file count=2000000 bs=1024 chmod go= /var/swap.file mkswap /var/swap.file echo "/var/swap.file swap swap defaults 0 0" >> /etc/fstab swapon -a

Actual behavior

But now with , /etc/fstab becomes read-only, I cannot change the swap space.

Information

  • Full output of the diagnostics from "Diagnose & Feedback" in the menu
    `
    Docker for Mac: version: 17.12.0-ce-mac46 (a61e84b8bca06b1ae6ce058cdd7beab1520ad622)
    macOS: version 10.13.2 (build: 17C205)
    logs: /tmp/782B526A-409B-4940-B624-79FD4825EDC4/20180110-010251.tar.gz
    [OK] db.git
    [OK] vmnetd
    [OK] dns
    [OK] driver.amd64-linux
    [OK] virtualization VT-X
    [OK] app
    [OK] moby
    [OK] system
    [OK] moby-syslog
    [OK] kubernetes
    [OK] env
    [OK] virtualization kern.hv_support
    [OK] slirp
    [OK] osxfs
    [OK] moby-console
    [OK] logs
    [OK] docker-cli
    [OK] menubar
    [OK] disk
    Failure: Could not upload diagnostic data to remote server (docker-diagnose exit code is 1)

You can also run diagnostics manually :
$ /Applications/Docker.app/Contents/Resources/bin/docker-diagnose -u
`

  • A reproducible case if this is a bug, Dockerfiles FTW
  • Page URL if this is a docs issue or the name of a man page

Steps to reproduce the behavior

  1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
  2. echo "/var/swap.file swap swap defaults 0 0" >> /etc/fstab
@guillaumerose

This comment has been minimized.

Copy link
Member

commented Jan 10, 2018

In the last version, we switch to linuxkit. /etc/ is now readonly. I'm afraid that for the moment you will have to activate the swap after each start.

Try to not edit fstab and just run swapon /var/swap.file. You probably need to put the file in /var/lib/.

@anfernee-cyanoly

This comment has been minimized.

Copy link
Author

commented Jan 10, 2018

Thanks, workaround works.

@guillaumerose

This comment has been minimized.

Copy link
Member

commented Jan 10, 2018

We will add a setting for that in future version. I've create an issue in our internal tracker. Thanks for the report !

@lxweifool

This comment has been minimized.

Copy link

commented Jan 17, 2018

I want't to edit /etc/hosts in 17.12.0-ce-mac47 (21805). It's readonly. Is there any methods? @guillaumerose
Thanks.

previous steps:

  1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
  2. vi /etc/hosts
@guillaumerose

This comment has been minimized.

Copy link
Member

commented Jan 17, 2018

It should be done by vpnkit. I suppose if you do it on the host it will work directly without having to modify /etc/hosts in the VM. Am I right @djs55 ?

@grumpit

This comment has been minimized.

Copy link

commented Jan 22, 2018

I am trying to increase swap for an Oracle build, and I can do everything except swapon /var/swap.file, which was working before, but now always returns swapon: /var/swap.file: swapon failed: Invalid argument
output of docker info:

Containers: 3
 Running: 1
 Paused: 0
 Stopped: 2
Images: 81
Server Version: 17.12.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.802GiB
Name: linuxkit-025000000001
ID: EJY2:UHVZ:GP75:JNOM:4W2R:HOZY:UQPS:VSIG:RAFF:3RSM:23GZ:4SYY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 28
 Goroutines: 45
 System Time: 2018-01-22T18:54:41.95968898Z
 EventsListeners: 2
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
@grumpit

This comment has been minimized.

Copy link

commented Jan 22, 2018

UPDATE
moving the swap.file from /var/swap.file to /var/lib/swap.file and then running swapon /var/lib/swap.file worked as expected.

@cooniur

This comment has been minimized.

Copy link

commented Jun 12, 2018

@guillaumerose Apology for the previous report as it was resolved after restarting the docker engine. Thanks!

@prabath

This comment has been minimized.

Copy link

commented Feb 23, 2019

Is there a way to make it read/write. Trying to install apparmor - but due to filesystem being readonly cannot do it.

linuxkit-025000000001:/# apk update && apk add apparmor
ERROR: Unable to lock database: Read-only file system
ERROR: Failed to open apk database: Read-only file system

Thanks..!

@7AC

This comment has been minimized.

Copy link

commented Jun 25, 2019

It should be done by vpnkit. I suppose if you do it on the host it will work directly without having to modify /etc/hosts in the VM. Am I right @djs55 ?

Doesn't seem to be picking it up from the host even after restarting docker. @guillaumerose can you elaborate on how we'd use vpnkit for this? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.