docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: unknown platform: kvm: unknown.
JADDYK opened this issue · comments
Description
I want to start gvisor with KVM. I changed /etc/docker/daeon.json and added "--platform=kvm". My host supports the KVM function which satisfies the Prerequisites in https://gvisor.dev/docs/user_guide/platforms/.
Docker cannot start on my host, so there are no bug logs in /tmp/runsc file. Are there some mistakes in my configuration or gvsior kvm platform? My host can run gvsior with the default platform configuration.
Steps to reproduce
No response
runsc version
runsc version release-20240325.0-19-g7d68056681dd-dirty
spec: 1.1.0-rc.1
docker version (if using docker)
Client: Docker Engine - Community
Version: 26.0.0
API version: 1.45
Go version: go1.21.8
Git commit: 2ae903e
Built: Wed Mar 20 15:17:48 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.0.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.8
Git commit: 8b79278
Built: Wed Mar 20 15:17:48 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
uname
Linux ubuntu 6.5.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
kubectl (if using Kubernetes)
No response
repo state (if built from source)
runsc debug logs (if available)
No response
Docker cannot start on my host, so there are no bug logs in /tmp/runsc file.
Are you passing a --debug-log=
flag? Can you pass `--debug-log=/tmp/runsc/" (the trailing forward slash is important). It will create a directory at /tmp/runsc/ and create log files there. https://gvisor.dev/docs/user_guide/debugging/.
Oh, I solve the problem. I check the symbol table and find that no kvm symbol.
I import "gvisor.dev/gvisor/pkg/sentry/platform/kvm" in file runsc/boot/platforms/platforms_debug.go and change default_platform, save_restore_platforms to "kvm" in file "tools/bazeldefs/platforms.bzl".
My solution is very strange. Maybe my environment have some problems.