Install Basic Packages
Switch to a Domestic Mirror
Backup Original Configuration
Edit Source Configuration File
Replace the content in the file with the following USTC mirror configuration
Press ctrl+o and Enter to confirm the filename and save, then ctrl+x to exit
Update package index
Optional: Upgrade system packages
Verification: After running sudo apt update, check if the output displays mirrors.ustc.edu.cn.
Set Password
Enable SSH
Expand QEMU Virtual Machine Disk Capacity
Add New Disk Space to Partition
First, Determine Which Partition to Expand
| Device | Start | End | Sectors | Size | Type |
|---|---|---|---|---|---|
| /dev/vda1 | 262144 | 6289407 | 6027264 | 2.9G | Linux root (ARM-64) |
| /dev/vda15 | 2048 | 262143 | 260096 | 127M | EFI System |
Find the partition where Linux root is located, and the End value should be the largest to ensure the primary partition is at the end, as this method can only expand the last partition. Here it is
/dev/vda1
Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| unexpected output in sfdisk --version | growpart syntax error | Check if it is in the format growpart /dev/vda 1 |
| NOCHANGE: partition 1 is size XXX. it cannot be grown | Partition is already at maximum size | Indicates that it has been expanded previously |
| resize2fs: Bad magic number | File system is not ext4 | Use xfs_growfs or other corresponding commands |
| /dev/vda1: No such file or directory | Incorrect partition number | Use lsblk to confirm the correct partition number |
Install Docker
Method 1 - Manual Installation
Method 2 - One-Click Installation via Script
Using Docker Without Root
⚠️ Notes
Firewall Compatibility: Docker creates its own iptables rules. If you are using ufw or firewalld, note that ports opened by Docker might bypass these firewall rules.
Network Issues: If you are in China, pulling images from Docker Hub might be slow. Consider configuring a domestic mirror accelerator to improve speed.
Version Selection: If you want to install a specific version of Docker, first use the apt-cache madison docker-ce command to view all available versions, then use the VERSION_STRING parameter to specify the installation.