gvisor/g3doc/user_guide/FAQ.md

153 lines
6.0 KiB
Markdown
Raw Normal View History

# FAQ
2019-03-30 04:09:15 +00:00
2020-04-30 01:54:48 +00:00
[TOC]
2020-03-26 22:32:10 +00:00
### What operating systems are supported? {#supported-os}
Today, gVisor requires Linux.
2020-03-27 00:27:48 +00:00
### What CPU architectures are supported? {#supported-cpus}
gVisor currently supports [x86_64/AMD64](https://en.wikipedia.org/wiki/X86-64)
2020-04-28 19:51:24 +00:00
compatible processors. Preliminary support is also available for
[ARM64](https://en.wikipedia.org/wiki/ARM_architecture#AArch64).
2020-03-26 22:32:10 +00:00
### Do I need to modify my Linux application to use gVisor? {#modify-app}
No. gVisor is capable of running unmodified Linux binaries.
2020-03-27 00:27:48 +00:00
### What binary formats does gVisor support? {#supported-binaries}
gVisor supports Linux
[ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) binaries.
2020-04-28 19:51:24 +00:00
Binaries run in gVisor should be built for the
2020-04-28 19:51:24 +00:00
[AMD64](https://en.wikipedia.org/wiki/X86-64) or
[AArch64](https://en.wikipedia.org/wiki/ARM_architecture#AArch64) CPU
architectures.
2020-03-26 22:32:10 +00:00
### Can I run Docker images using gVisor? {#docker-images}
2019-10-18 06:40:54 +00:00
Yes. Please see the [Docker Quick Start][docker].
2020-03-26 22:32:10 +00:00
### Can I run Kubernetes pods using gVisor? {#k8s-pods}
2019-12-19 20:11:17 +00:00
Yes. Please see the [Kubernetes Quick Start][k8s].
2020-03-26 22:32:10 +00:00
### What's the security model? {#security-model}
2019-10-18 06:40:54 +00:00
See the [Security Model][security-model].
## Troubleshooting
2020-03-26 22:32:10 +00:00
### My container runs fine with `runc` but fails with `runsc` {#app-compatibility}
2019-03-30 02:40:11 +00:00
If youre having problems running a container with `runsc` its most likely due
to a compatibility issue or a missing feature in gVisor. See
2019-10-18 06:40:54 +00:00
[Debugging][debugging].
2019-03-30 02:40:11 +00:00
2020-03-26 22:32:10 +00:00
### When I run my container, docker fails with: `open /run/containerd/.../<containerid>/log.json: no such file or directory` {#memfd-create}
2019-05-31 11:27:24 +00:00
You are using an older version of Linux which doesn't support `memfd_create`.
2019-10-18 06:40:54 +00:00
This is tracked in [bug #268](https://gvisor.dev/issue/268).
2019-05-31 11:27:24 +00:00
2020-03-27 00:27:48 +00:00
### When I run my container, docker fails with: `flag provided but not defined: -console` {#old-docker}
2019-03-30 02:40:11 +00:00
2019-10-18 06:40:54 +00:00
You're using an old version of Docker. See [Docker Quick Start][docker].
2019-03-30 02:40:11 +00:00
2020-03-26 22:32:10 +00:00
### I cant see a file copied with: `docker cp` {#fs-cache}
2019-03-30 02:40:11 +00:00
For performance reasons, gVisor caches directory contents, and therefore it may
not realize a new file was copied to a given directory. To invalidate the cache
and force a refresh, create a file under the directory in question and list the
contents again.
As a workaround, shared root filesystem can be enabled. See
[Filesystem][filesystem].
2019-10-18 06:40:54 +00:00
This bug is tracked in [bug #4](https://gvisor.dev/issue/4).
2019-03-30 02:40:11 +00:00
Note that `kubectl cp` works because it does the copy by exec'ing inside the
sandbox, and thus gVisor's internal cache is made aware of the new files and
directories.
2019-03-30 02:40:11 +00:00
2020-03-26 22:32:10 +00:00
### I'm getting an error like: `panic: unable to attach: operation not permitted` or `fork/exec /proc/self/exe: invalid argument: unknown` {#runsc-perms}
2019-07-10 17:38:53 +00:00
Make sure that permissions is correct on the `runsc` binary.
2019-07-10 17:38:53 +00:00
```bash
sudo chmod a+rx /usr/local/bin/runsc
2019-07-10 17:38:53 +00:00
```
2020-03-26 22:32:10 +00:00
### I'm getting an error like `mount submount "/etc/hostname": creating mount with source ".../hostname": input/output error: unknown.` {#memlock}
There is a bug in Linux kernel versions 5.1 to 5.3.15, 5.4.2, and 5.5. Upgrade
to a newer kernel or add the following to
`/lib/systemd/system/containerd.service` as a workaround.
```
LimitMEMLOCK=infinity
```
And run `systemctl daemon-reload && systemctl restart containerd` to restart
containerd.
See [issue #1765](https://gvisor.dev/issue/1765) for more details.
### I'm getting an error like `RuntimeHandler "runsc" not supported` {#runtime-handler}
This error indicates that the Kubernetes CRI runtime was not set up to handle
`runsc` as a runtime handler. Please ensure that containerd configuration has
been created properly and containerd has been restarted. See the
[containerd quick start](containerd/quick_start.md) for more details.
If you have ensured that containerd has been set up properly and you used
kubeadm to create your cluster please check if Docker is also installed on that
system. Kubeadm prefers using Docker if both Docker and containerd are
installed.
Please recreate your cluster and set the `--cri-socket` option on kubeadm
commands. For example:
```bash
kubeadm init --cri-socket=/var/run/containerd/containerd.sock ...
```
To fix an existing cluster edit the `/var/lib/kubelet/kubeadm-flags.env` file
and set the `--container-runtime` flag to `remote` and set the
`--container-runtime-endpoint` flag to point to the containerd socket. e.g.
`/var/run/containerd/containerd.sock`.
2020-03-26 22:32:10 +00:00
### My container cannot resolve another container's name when using Docker user defined bridge {#docker-bridge}
2019-03-30 02:40:11 +00:00
2019-09-10 00:06:36 +00:00
This is normally indicated by errors like `bad address 'container-name'` when
trying to communicate to another container in the same network.
Docker user defined bridge uses an embedded DNS server bound to the loopback
interface on address 127.0.0.10. This requires access to the host network in
order to communicate to the DNS server. runsc network is isolated from the host
and cannot access the DNS server on the host network without breaking the
2019-09-10 00:06:36 +00:00
sandbox isolation. There are a few different workarounds you can try:
* Use default bridge network with `--link` to connect containers. Default
bridge doesn't use embedded DNS.
* Use [`--network=host`][host-net] option in runsc, however beware that it
will use the host network stack and is less secure.
* Use IPs instead of container names.
* Use [Kubernetes][k8s]. Container name lookup works fine in Kubernetes.
### I'm getting an error like `dial unix /run/containerd/s/09e4...8cff: connect: connection refused: unknown` {#shim-connect}
This error may happen when using `gvisor-containerd-shim` with a `containerd`
that does not contain the fix for [CVE-2020-15257]. The resolve the issue,
update containerd to 1.3.9 or 1.4.3 (or newer versions respectively).
2019-10-18 06:40:54 +00:00
[security-model]: /docs/architecture_guide/security/
[host-net]: /docs/user_guide/networking/#network-passthrough
2019-10-18 06:40:54 +00:00
[debugging]: /docs/user_guide/debugging/
[filesystem]: /docs/user_guide/filesystem/
[docker]: /docs/user_guide/quick_start/docker/
[k8s]: /docs/user_guide/quick_start/kubernetes/
[CVE-2020-15257]: https://github.com/containerd/containerd/security/advisories/GHSA-36xw-fx78-c5r4