From b141b21d0f1c676ac66af17e403a6a4b3bf42565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Dom=C3=ADnguez=20Ochoa?= Date: Thu, 9 Apr 2026 19:12:13 +0200 Subject: [PATCH] home podman setup fixes --- README.md | 4 ++-- scripts/hcf/podman_setup | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2d3f756..74fdb4a 100644 --- a/README.md +++ b/README.md @@ -127,10 +127,10 @@ sudo apt update && sudo apt install terraform ```bash # System packages -sudo apt install alacritty zsh tmux stow zsh-syntax-highlighting less python3-libtmux cbonsai shfmt shellcheck lua-check secret-tool wl-clipboard +sudo apt install alacritty zsh tmux stow zsh-syntax-highlighting less python3-libtmux cbonsai shfmt shellcheck lua-check secret-tool wl-clipboard podman quemu-system-x86 qemu-utils virtiofsd gvproxy # Homebrew packages -brew install neovim stylua lua-language-server bash-language-server prettier terraform-ls tflint ruff markdownlint-cli2 fzf tree-sitter-cli podman +brew install neovim stylua lua-language-server bash-language-server prettier terraform-ls tflint ruff markdownlint-cli2 fzf tree-sitter-cli # Node packages npm install --save-dev prettier prettier-plugin-go-template diff --git a/scripts/hcf/podman_setup b/scripts/hcf/podman_setup index 856a8d0..e7ac456 100755 --- a/scripts/hcf/podman_setup +++ b/scripts/hcf/podman_setup @@ -11,6 +11,39 @@ if ! command -v podman &>/dev/null; then exit 1 fi +if [[ "$(uname -s)" == Linux* ]]; then + if ! command -v gvproxy &>/dev/null; then + echo "Error: gvproxy is not installed" + exit 1 + fi + + if ! command -v qemu-img &>/dev/null; then + echo "Error: qemu-img is not installed (usually provided by the qemu-utils package)" + exit 1 + fi + + if ! command -v qemu-system-x86 &>/dev/null && ! command -v qemu-system-x86_64 &>/dev/null; then + echo "Error: qemu-system-x86 is not installed" + exit 1 + fi + + if [[ ! -f /usr/libexec/virtiofsd ]]; then + echo "Error: virtiofsd is not installed in /usr/libexec/" + exit 1 + fi + + if [[ ! -e /usr/local/bin/virtiofsd ]]; then + echo "Linking virtiofsd to /usr/local/bin (requires sudo)..." + sudo ln -s /usr/libexec/virtiofsd /usr/local/bin/virtiofsd + fi + + if [[ ! -e /usr/local/libexec/podman/gvproxy ]]; then + echo "Setting up gvproxy in /usr/local/libexec/podman (requires sudo)..." + sudo mkdir -p /usr/local/libexec/podman + sudo ln -s "$(command -v gvproxy)" /usr/local/libexec/podman/gvproxy + fi +fi + case "$(uname -s)" in Darwin*) memory=12288 ;; Linux*) memory=8192 ;; @@ -57,7 +90,7 @@ esac case "$(uname -s)" in Darwin*) resolved_ip=$(dscacheutil -q host -a name host.docker.internal 2>/dev/null | awk '/^ip_address:/{print $2; exit}') ;; - *) resolved_ip=$(getent hosts host.docker.internal 2>/dev/null | awk '{print $1}') ;; + *) resolved_ip=$(getent hosts host.docker.internal 2>/dev/null | awk '{print $1}' || true) ;; esac if [[ -z "$resolved_ip" ]] || ! echo "$resolved_ip" | grep -qE '^(127\.|::1$)'; then echo "Adding host.docker.internal to /etc/hosts (requires sudo)..."