下面给你一份从零开始在 VirtualBox 里安装 Debian的实操步骤,适合新手,按顺序来就行。
一、准备材料
-
安装 VirtualBox
- 官网:https://www.virtualbox.org
- 按你系统(Windows / macOS / Linux)下载并安装
-
下载 Debian 镜像
- 推荐用 DVD / Netinst 版
- 官网:https://www.debian.org/distrib/
- 一般选:
debian-12.x.x-amd64-DVD-1.iso(离线可用)
- 或
debian-12.x.x-amd64-netinst.iso(需联网)
二、创建虚拟机
- 打开 VirtualBox → 点 新建
- 基本信息:
- 名称:Debian
- 类型:Linux
- 版本:Debian (64-bit)
- 内存(RAM):
- 硬盘:
- 创建虚拟硬盘
- 类型:VDI
- 动态分配
- 大小:建议 20GB 以上
三、挂载 Debian 镜像
- 选中刚建好的虚拟机 → 设置
- 存储 → 控制器 IDE → 光驱
- 选择你下载的
.iso 文件
- 确定
四、启动并安装 Debian
- 启动虚拟机
- 出现安装界面后,选择:
Install(字符界面)
- 或
Graphical install(图形界面,推荐新手)
安装过程要点
- 语言:中文(简体)或 English
- 地区:中国
- 键盘:汉语
- 主机名:默认或自定义
- 用户名 / 密码:自己记住
- 磁盘分区:
- 新手直接选 “ guided - use entire disk ”
- 软件选择:
- 建议勾选:
- Debian desktop environment
- GNOME(或 Xfce,轻量)
- 安装 GRUB:
五、安装后设置(重要)
1. 安装增强功能(Guest Additions)
- 虚拟机启动后
- 菜单:设备 → 安装增强功能
- 在 Debian 里执行:
sudo apt update
sudo apt install build-essential dkms linux-headers-$(uname -r)
然后运行光盘里的:
sudo sh /media/cdrom/VBoxLinuxAdditions.run
作用:
2. 换国内源(可选但推荐)
sudo nano /etc/apt/sources.list
换成(示例):
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main
然后:
sudo apt update
六、常见问题
Q:启动黑屏?
- 确认选了 64-bit
- 开启 BIOS 的虚拟化(VT-x / AMD-V)
Q:不能全屏?
Q:网络不通?
如果你愿意,我可以:
- 给你 一步步截图版
- 或针对 Windows / macOS 用户
- 或装 无桌面版 Debian(服务器)
你现在是哪种使用场景?