Complete Tutorial: Installing Debian + Docker + MC Server Panel on Android Using QEMU
Organized and polished by: Hermes
1. Environment Preparation
1.1 Hardware Requirements
| Item | Minimum Configuration | Recommended Configuration |
|---|---|---|
| OS Version | Android 7.0+ | Android 12+ |
| Storage Space | 16GB | 32GB+ |
| Memory | 4GB | 6GB+ (allocate 2GB+ to the VM) |
| Processor | ARM64 | ARM64 |
1.2 Software Preparation
- Termux (recommended to download from F-Droid; the Google Play version is outdated)
- VNC Client (optional, for graphical interface)
- Stable network connection
2. Install Termux and Essential Tools
2.1 Update Packages
2.2 Install QEMU and Related Dependencies
Tool Description:
| Package Name | Function |
|---|---|
| qemu-utils | Disk image management tool |
| qemu-common | QEMU common components |
| qemu-system-aarch64-headless | ARM64 system emulator (headless/no GUI) |
| wget / curl | File download |
| vim | Text editor |
| openssh | SSH client/server |
3. Detailed Explanation of QEMU Parameters
3.1 Basic Parameter Quick Reference Table
| Parameter | Description | Example |
|---|---|---|
-M | Virtual machine motherboard type | -M virt |
-cpu | CPU model | -cpu cortex-a72 |
-smp | Number of CPU cores | -smp 4 |
-m | Memory size | -m 2048 |
-drive | Disk image | -drive file=debian.img,format=raw |
-cdrom | ISO image | -cdrom debian.iso |
-boot | Boot order | -boot d (boot from CD-ROM) |
-netdev | Network device | -netdev user,id=net0 |
-device | Device passthrough | -device virtio-net,netdev=net0 |
-nographic | No graphical interface | -nographic |
-vnc | VNC remote desktop | -vnc :1 |
-usb | USB device support | -usb -device usb-host,... |
3.2 Network Configuration
By default, user-mode networking (NAT) is used. The VM can access the external network, but the external network cannot directly access the VM.
If external access is required (e.g., for an MC server), port forwarding needs to be configured:
3.3 USB Passthrough
Pass Android host USB devices to the VM:
4. Complete Installation Process
4.1 Download Debian ISO
It is recommended to download the netinst (network installation) version due to its small size. If the network environment is poor, you can download the DVD version.
4.2 Create Disk Image
- The
qcow2format supports on-demand space allocation, snapshots, and compression. - Adjust capacity as needed; 16GB allows installing the base system + Docker + MC panel.
4.3 Start the Installer
Follow the installation wizard to complete the Debian installation. The ARM64 version installation process is basically the same as x86, but note the following:
- It is recommended to use the ext4 file system during partitioning.
- At least check "SSH server" when selecting software packages.
- Remember the root password.
4.4 Start the Installed System
After installation is complete, remove the ISO and restart:
5. Install Docker in the VM
After logging into the Debian VM via SSH or console:
5.1 Install Docker
5.2 Verify Installation
6. Deploy MC Server Panel
6.1 Quick Deployment Using Docker
It is recommended to use Docker to deploy the MC server panel (such as Pterodactyl, PanelCraft, etc.):
6.2 Port Forwarding
To allow friends on the external network to access the MC server in your phone's VM, you need to add port forwarding when starting QEMU:
This way, external access to PhoneIP:25565 will be forwarded to port 25565 inside the VM.
7. Using VNC Graphical Interface (Optional)
If a graphical interface is needed:
Then use a VNC client on Android to connect to 127.0.0.1:5901.
8. One-Click Startup Script
Save the following content as start-debian.sh for convenient quick startup later:
Summary
The complete chain of this solution:
Key Points
- Performance is the key bottleneck; it is recommended to run on devices with good performance.
- Resource allocation needs to be reasonably adjusted according to the device situation (CPU and memory).
- Docker greatly simplifies the deployment and management of the MC server panel.
- USB passthrough allows the VM to use external hardware devices.
Precautions
- Android device performance is limited; it is not suitable for running large MC servers (recommended for small private servers, 5-10 players).
- Long-term operation generates heat; pay attention to heat dissipation.
- It is recommended to use while connected to a charger.
- Regularly back up important data (
debian.img, databases). - Please comply with local laws and regulations.
Good luck with your setup!