VirtualBox 里的 Debian 卡顿,通常不是单一原因,可以从虚拟化设置、系统配置、驱动、资源分配几个方面排查。下面按最常见 → 进阶给你一套实用方案。
很多卡顿都是没装增强功能导致的。
sudo apt update
sudo apt install -y build-essential dkms linux-headers-$(uname -r)
然后:
cd /media/cdrom
sudo sh VBoxLinuxAdditions.run
✅ 效果:
设置 → 显示
设置 → 系统
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
或干脆换轻量桌面:
sudo apt install xfce4
登录时选 Xfce
✅ 对虚拟机非常友好
设置 → 存储
sudo systemctl disable snapd
sudo systemctl disable bluetooth
检查:
swapon --show
如果 没有 swap:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
加入开机自动挂载:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list
sudo apt update
✅ 换虚拟机软件
✅ 换发行版
如果你愿意,可以告诉我:
我可以给你针对你环境的精确优化方案。