- 使用 SSH 连接(最推荐的方式)
这是最专业、最稳定的方式,特别适合服务器环境:
一、在 Ubuntu Server 中确保 SSH 服务已安装并运行:
sudo apt update
sudo apt install -y openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
二、获取虚拟机的 IP 地址:
ip addr show
三、从主机使用 SSH 客户端连接:
Windows: 使用 PowerShell 或命令提示符中的 ssh 命令
ssh username@虚拟机IP地址