Proxmox VM Setup

For Mobile App Development

A comprehensive guide to setting up your development environment in Proxmox

Android & iOS

Proxmox VE

Why Use Proxmox for Mobile Development?

Performance

Dedicated resources ensure smooth emulator performance and fast builds.

Isolation

Separate environments for different projects or team members.

Security

Sandboxed development environments protect your main system.

System Requirements

Component Minimum Recommended
CPU Cores 4 cores 8+ cores
RAM 8GB 16GB+
Storage 50GB SSD 100GB+ NVMe
GPU Basic Passthrough for better emulation

Step-by-Step Setup Guide

1

Create a New Virtual Machine

In the Proxmox web interface, create a new VM with these specifications:

OS: Ubuntu Server 22.04 LTS

CPU: 4+ cores (enable NUMA for >8 cores)

Memory: 8GB+ (enable Ballooning)

Disk: 50GB+ (Thin provision, SSD preferred)

Network: VirtIO (bridged mode)

Tip: For Android emulation, enable KVM hardware virtualization in the VM options.

2

Install Required Packages

After installing Ubuntu, SSH into your VM and run these commands:

sudo apt update && sudo apt upgrade -y

sudo apt install -y openjdk-17-jdk git curl unzip qemu-kvm libvirt-daemon-system \

libvirt-clients bridge-utils virt-manager libguestfs-tools libosinfo-bin \

qemu-utils python3-pip android-sdk-platform-tools

Java Git QEMU/KVM Android Tools
3

Install Development Tools

For Android Development:

# Install Android Studio

sudo snap install android-studio --classic

# Configure environment variables

echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.bashrc

echo 'export PATH=$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools' >> ~/.bashrc

source ~/.bashrc

For iOS Development (Cross-Platform):

# Install Flutter

sudo snap install flutter --classic

flutter doctor

# Install Xcode dependencies (for building iOS apps)

sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev

Note: Full iOS development requires macOS. Consider a macOS VM or physical Mac for final builds.

4

Configure Android Emulator

To create and run an Android Virtual Device (AVD):

# List available system images

sdkmanager --list

# Install a system image

sdkmanager "system-images;android-33;google_apis;x86_64"

# Create an AVD

avdmanager create avd -n Pixel_5_API_33 -k "system-images;android-33;google_apis;x86_64" -d pixel_5

# Run the emulator

emulator -avd Pixel_5_API_33 -gpu host -no-snapshot-load

Performance Tip: Use -gpu host for better graphics performance. For ARM images, enable -accel on for hardware acceleration.

5

Optimize Your Setup

Performance Tweaks:

  • Enable CPU pinning in Proxmox for better performance
  • Allocate more RAM to the VM if emulator is slow
  • Use virtio-scsi for disk controller with write-back cache
  • Enable nested virtualization if needed

Development Tips:

  • Set up SSH access for remote development
  • Install VS Code Server for web-based IDE
  • Configure regular snapshots for easy rollback
  • Set up a backup schedule for your VM

Remote Access Setup

VS Code Remote Development

  1. Install the "Remote - SSH" extension in VS Code
  2. Add your VM to SSH config:

    Host mobile-dev-vm

    HostName your-vm-ip

    User your-username

    IdentityFile ~/.ssh/your-key.pem

  3. Connect to the remote host and install required extensions

Android Emulator Access

To access the emulator display remotely:

# On the VM, run emulator with:

emulator -avd Your_AVD -gpu swiftshader_indirect -no-audio -no-window

# Forward the display to your local machine:

ssh -X user@your-vm-ip

export DISPLAY=:10

Alternative Methods You can also use VNC or RDP for full desktop access to your VM

Troubleshooting

Emulator Not Starting

If you get "Failed to start emulator: Cannot launch AVD" errors:

  • Check KVM is enabled: kvm-ok
  • Ensure nested virtualization is enabled in Proxmox
  • Try different GPU options: -gpu swiftshader_indirect or -gpu host

Slow Performance

If the emulator or builds are slow:

  • Allocate more CPU cores and RAM to the VM
  • Use SSD storage with virtio-scsi controller
  • Disable unnecessary services in the VM
  • Consider using ARM system images with hardware acceleration

Network Issues

If you have connectivity problems:

  • Check Proxmox network bridge configuration
  • Ensure the VM has proper IP configuration
  • Verify firewall rules aren't blocking connections
  • Test with different network modes (NAT vs Bridged)

Made with DeepSite LogoDeepSite - 🧬 Remix