18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

wsl2のDocker runでexited(139)が起きた場合の回避策

Last updated at Posted at 2020-06-06

TL;DR

  • CentOS6など、古いベースイメージの起動に失敗(エラーコード:139)が発生することへの回避策

動作環境

  • Windows 10 Home 64bit (2004)
  • Ubuntu 18.04 LTS
  • WSL2
  • Docker 19.03.08

回避策

まずは、ホストの%USERPROFILE%/.wslconfigに、以下を追記した上で、WSL2を再起動する
:point_up: wsl -t だけではダメそうだったのでPCごと再起動が無難だと思います

[wsl2]
kernelCommandLine=vsyscall=emulate

確認

WSL2にログインし、以下のコマンドを実行し、vsyscall=emulate が追記されていればOK

cat /proc/cmdline
-> initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=4 vsyscall=emulate

試しに、centosイメージを起動してみて、Exited(139)になっていなければ解決

docker pull centos:6
docker run -dti centos:6 /bin/bash
docker ps

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
6fe6f93cf876        centos:6            "/bin/bash"         4 seconds ago       Up 2 seconds                            dreamy_burnell

参考URL

Enable vsyscall=emulate in the kernel config to run older base images such as Centos 6 #4694

18
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?