VirtualBox安装Debian12

发布时间 2023-11-18 16:32:17作者: rustling

下载地址:

安装

打开VirtualBox,点击新建,根据提示安装。

安装时网络不佳建议断网,避免更新下载耗时太久。
使用putty/xshell连接服务器,需要设置网络为桥接网卡,以获取内网IP。
输入的用户密码就是root用户密码。切换root用户: su -

配置

1. Debian配置国内镜像

# 切换root用户,普通用户修改无法保存
su
# vi /etc/apt/sources.list
# 清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# 刷新
apt update

2. 启用ssh服务

# 查看是否有ssh服务
systemctl status ssh
# 如果提示 ssh.service could not be found 则需要安装ssh服务
apt install openssh-server
# 获取IP地址
ip addr
# 接下来就可以用putty/xshell等工具登录