From c20c49d5e018995e43643b435f1f3f11b31f501a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 19:42:18 +0000 Subject: [PATCH 1/3] fix: Remove unnecessary aios.zsh and config.json - Delete aios-startup script copying and sourcing - Delete config.json creation - Simplify .zshrc to only include claude auto-start - Fixes claude not starting on ai user login --- cfg/setup-user.sh | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/cfg/setup-user.sh b/cfg/setup-user.sh index 68a7bcb..54c8f44 100755 --- a/cfg/setup-user.sh +++ b/cfg/setup-user.sh @@ -74,24 +74,4 @@ EOF arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc' -# Copy aios startup script -cp -rf ./cfg/aios.zsh $ROOTFS/usr/local/bin/aios-startup -arch-chroot $ROOTFS /bin/sh -c 'chmod +x /usr/local/bin/aios-startup' - -# Create default config directory and file for user 'ai' -arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /home/ai/.config/syui/ai/os' -cat > $ROOTFS/home/ai/.config/syui/ai/os/config.json <<'EOF' -{ - "shell": false -} -EOF -arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config' - -# Update .zshrc to source startup script -cat >> $ROOTFS/home/ai/.zshrc <<'EOF' - -# aios startup -source /usr/local/bin/aios-startup -EOF - echo "✓ User setup complete" From 3d86677dd2a9883c98f56e8a1da06dfee0e695bc Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 19:44:20 +0000 Subject: [PATCH 2/3] fix: Add network configuration to install.sh - Create /etc/systemd/nspawn/aios.nspawn during installation - Set Network Private=no to share host network - Allows claude to connect to api.anthropic.com - Fixes EAI_AGAIN network error --- cfg/install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cfg/install.sh b/cfg/install.sh index a0c980b..d86ff55 100644 --- a/cfg/install.sh +++ b/cfg/install.sh @@ -11,6 +11,17 @@ tar xf "$TARBALL" mkdir -p /var/lib/machines mv root.x86_64 /var/lib/machines/$NAME +# Create aios.nspawn for network access +echo "Creating network configuration..." +mkdir -p /etc/systemd/nspawn +cat > /etc/systemd/nspawn/$NAME.nspawn <<'EOF' +[Exec] +Boot=yes + +[Network] +Private=no +EOF + echo "=== Installation complete ===" echo "" echo "Usage:" From b7b59f593a081e68d9fc19d2a388b3de78344da8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 20:17:02 +0000 Subject: [PATCH 3/3] refactor: Enable workspace auto-entry with full sudo and skip permissions - Restore workspace auto-entry on ai user login - Use systemd-nspawn -q -D to enter workspace - Start claude with --dangerously-skip-permissions (no approval needed) - Grant wheel group full sudo access (NOPASSWD: ALL) for container operation - ai user can perform all root operations via sudo in workspace --- build.zsh | 4 ++-- cfg/setup-user.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build.zsh b/build.zsh index 24f71f7..3455346 100755 --- a/build.zsh +++ b/build.zsh @@ -63,9 +63,9 @@ arch-chroot root.x86_64 /bin/sh -c 'npm i -g @anthropic-ai/claude-code' # Copy os-release cp -rf ./cfg/os-release root.x86_64/etc/os-release -# Configure sudoers for wheel group +# Configure sudoers for wheel group (full access for container operation) echo "Configuring sudoers..." -arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/pacstrap, /usr/bin/arch-chroot, /usr/bin/rm, /usr/bin/mkdir, /usr/bin/mv, /usr/bin/cp, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl, /usr/bin/systemd-nspawn, /usr/bin/mount, /usr/bin/chroot, /bin/bash" >> /etc/sudoers' +arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers' # Install aigpt (aios core package) echo "Installing aigpt..." diff --git a/cfg/setup-user.sh b/cfg/setup-user.sh index 54c8f44..ae68f00 100755 --- a/cfg/setup-user.sh +++ b/cfg/setup-user.sh @@ -61,13 +61,20 @@ cp -rf ./cfg/zshrc $ROOTFS/root/.zshrc # Copy .zshrc for user 'ai' cp -rf ./cfg/zshrc $ROOTFS/home/ai/.zshrc -# Add claude auto-start on login (once, not exec) +# Add workspace auto-entry and claude auto-start cat >> $ROOTFS/home/ai/.zshrc <<'EOF' -# Start claude on login (once) +# aios: auto-enter workspace container if [[ -o login ]] && [[ -o interactive ]]; then - if command -v claude &>/dev/null; then - claude + if [[ -z "$INSIDE_WORKSPACE" ]]; then + # Enter workspace container + export INSIDE_WORKSPACE=1 + exec sudo systemd-nspawn -q -D /var/lib/machines/workspace /bin/zsh + else + # Inside workspace - start claude with skip permissions + if command -v claude &>/dev/null; then + claude --dangerously-skip-permissions + fi fi fi EOF