podman和vscode dev container的一些问题

1. Mac Arm芯片上podman machine启动时卡在Current Starting起不来。

参考这个链接的回答,更新Qemu的文件

https://github.com/containers/podman/issues/21096#issuecomment-1872551224

I have the same issue, and also tried some methods discussed in #21088 (comment), none of them works, but i found a clue in qemu issue 1990, which point to a edk2 firmware: edk2-aarch64-code.fd.bz2, I download it extract the file edk2-aarch64-code.fd ,and then replace the one in /opt/homebrew/share/qemu, then remove the old podman machine, and run the "podman machine init" and "podman machine start", and the vm started as expected.

重启Current Starting的podman machine的方法见下面链接

https://podman-desktop.io/docs/troubleshooting/troubleshooting-podman-on-macos#recovering-from-a-failed-start

Kill the remaining QEMU process and stop the Podman machine:

ps -edf | grep qemu-system | grep -v grep | awk '{print $2}' | xargs -I{} kill -9 {}; podman machine stop

 

2. 启动vscode dev container后遇到cannot create directory ‘/root’: Permission denied 之类权限问题

例如下列错误

Got permission denied while trying to connect to the Docker daemon socket at ...: dial unix /var/run/docker.sock: connect: permission denied

在.devcontainer/devcontainer.json里加入这段话

	"runArgs": [
		"--userns=keep-id",
		"--privileged"
	],
	"containerUser": "vscode",
	"containerEnv": {
		"HOME": "/home/vscode"
	},
	"remoteUser": "root",
	"remoteEnv": {
		"HOME": "/home/vscode"
	}

 

posted @ 2024-01-15 18:01  **smartheye**  阅读(93)  评论(0编辑  收藏  举报