github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/g3doc/user_guide/FAQ.md (about) 1 # FAQ 2 3 [TOC] 4 5 ### What operating systems are supported? {#supported-os} 6 7 Today, gVisor requires Linux. 8 9 ### What CPU architectures are supported? {#supported-cpus} 10 11 gVisor currently supports [x86_64/AMD64](https://en.wikipedia.org/wiki/X86-64) 12 compatible processors. Preliminary support is also available for 13 [ARM64](https://en.wikipedia.org/wiki/ARM_architecture#AArch64). 14 15 ### Do I need to modify my Linux application to use gVisor? {#modify-app} 16 17 No. gVisor is capable of running unmodified Linux binaries. 18 19 ### What binary formats does gVisor support? {#supported-binaries} 20 21 gVisor supports Linux 22 [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) binaries. 23 24 Binaries run in gVisor should be built for the 25 [AMD64](https://en.wikipedia.org/wiki/X86-64) or 26 [AArch64](https://en.wikipedia.org/wiki/ARM_architecture#AArch64) CPU 27 architectures. 28 29 ### Can I run Docker images using gVisor? {#docker-images} 30 31 Yes. Please see the [Docker Quick Start][docker]. 32 33 ### Can I run Kubernetes pods using gVisor? {#k8s-pods} 34 35 Yes. Please see the [Kubernetes Quick Start][k8s]. 36 37 ### What's the security model? {#security-model} 38 39 See the [Security Model][security-model]. 40 41 ## Troubleshooting 42 43 ### My container runs fine with `runc` but fails with `runsc` {#app-compatibility} 44 45 If you’re having problems running a container with `runsc` it’s most likely due 46 to a compatibility issue or a missing feature in gVisor. See 47 [Debugging][debugging]. 48 49 ### When I run my container, docker fails with: `open /run/containerd/.../<containerid>/log.json: no such file or directory` {#memfd-create} 50 51 You are using an older version of Linux which doesn't support `memfd_create`. 52 53 This is tracked in [bug #268](https://gvisor.dev/issue/268). 54 55 ### When I run my container, docker fails with: `flag provided but not defined: -console` {#old-docker} 56 57 You're using an old version of Docker. See [Docker Quick Start][docker]. 58 59 ### I can’t see a file copied with: `docker cp` {#fs-cache} 60 61 For performance reasons, gVisor caches directory contents, and therefore it may 62 not realize a new file was copied to a given directory. To invalidate the cache 63 and force a refresh, create a file under the directory in question and list the 64 contents again. 65 66 As a workaround, shared root filesystem can be enabled. See 67 [Filesystem][filesystem]. 68 69 This bug is tracked in [bug #4](https://gvisor.dev/issue/4). 70 71 Note that `kubectl cp` works because it does the copy by exec'ing inside the 72 sandbox, and thus gVisor's internal cache is made aware of the new files and 73 directories. 74 75 ### I'm getting an error like: `panic: unable to attach: operation not permitted` or `fork/exec /proc/self/exe: invalid argument: unknown` {#runsc-perms} 76 77 Make sure that permissions is correct on the `runsc` binary. 78 79 ```bash 80 sudo chmod a+rx /usr/local/bin/runsc 81 ``` 82 83 ### I'm getting an error like `mount submount "/etc/hostname": creating mount with source ".../hostname": input/output error: unknown.` {#memlock} 84 85 There is a bug in Linux kernel versions 5.1 to 5.3.15, 5.4.2, and 5.5. Upgrade 86 to a newer kernel or add the following to 87 `/lib/systemd/system/containerd.service` as a workaround. 88 89 ``` 90 LimitMEMLOCK=infinity 91 ``` 92 93 And run `systemctl daemon-reload && systemctl restart containerd` to restart 94 containerd. 95 96 See [issue #1765](https://gvisor.dev/issue/1765) for more details. 97 98 ### I'm getting an error like `RuntimeHandler "runsc" not supported` {#runtime-handler} 99 100 This error indicates that the Kubernetes CRI runtime was not set up to handle 101 `runsc` as a runtime handler. Please ensure that containerd configuration has 102 been created properly and containerd has been restarted. See the 103 [containerd quick start](containerd/quick_start.md) for more details. 104 105 If you have ensured that containerd has been set up properly and you used 106 kubeadm to create your cluster please check if Docker is also installed on that 107 system. Kubeadm prefers using Docker if both Docker and containerd are 108 installed. 109 110 Please recreate your cluster and set the `--cri-socket` option on kubeadm 111 commands. For example: 112 113 ```bash 114 kubeadm init --cri-socket=/var/run/containerd/containerd.sock ... 115 ``` 116 117 To fix an existing cluster edit the `/var/lib/kubelet/kubeadm-flags.env` file 118 and set the `--container-runtime` flag to `remote` and set the 119 `--container-runtime-endpoint` flag to point to the containerd socket. e.g. 120 `/var/run/containerd/containerd.sock`. 121 122 ### My container cannot resolve another container's name when using Docker user defined bridge {#docker-bridge} 123 124 This is normally indicated by errors like `bad address 'container-name'` when 125 trying to communicate to another container in the same network. 126 127 Docker user defined bridge uses an embedded DNS server bound to the loopback 128 interface on address 127.0.0.10. This requires access to the host network in 129 order to communicate to the DNS server. runsc network is isolated from the host 130 and cannot access the DNS server on the host network without breaking the 131 sandbox isolation. There are a few different workarounds you can try: 132 133 * Use default bridge network with `--link` to connect containers. Default 134 bridge doesn't use embedded DNS. 135 * Use [`--network=host`][host-net] option in runsc, however beware that it 136 will use the host network stack and is less secure. 137 * Use IPs instead of container names. 138 * Use [Kubernetes][k8s]. Container name lookup works fine in Kubernetes. 139 140 ### I'm getting an error like `dial unix /run/containerd/s/09e4...8cff: connect: connection refused: unknown` {#shim-connect} 141 142 This error may happen when using `gvisor-containerd-shim` with a `containerd` 143 that does not contain the fix for [CVE-2020-15257]. The resolve the issue, 144 update containerd to 1.3.9 or 1.4.3 (or newer versions respectively). 145 146 [security-model]: /docs/architecture_guide/security/ 147 [host-net]: /docs/user_guide/networking/#network-passthrough 148 [debugging]: /docs/user_guide/debugging/ 149 [filesystem]: /docs/user_guide/filesystem/ 150 [docker]: /docs/user_guide/quick_start/docker/ 151 [k8s]: /docs/user_guide/quick_start/kubernetes/ 152 [CVE-2020-15257]: https://github.com/containerd/containerd/security/advisories/GHSA-36xw-fx78-c5r4