本文介绍了使用VirtualBox的Headless Server的一些额外配置,包含extpack、SELinux、Windows VM的远程桌面密码配置等。

extpack

1
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.22.vbox-extpack

验证

1
VBoxManage list extpacks

用户

1
2
3
4
vim /etc/default/virtualbox
# 添加
VBOXWEB_USER=vbox
VBOXWEB_HOST=127.0.0.1

将运行VirtualBox的用户加入vboxusers组

1
usermod -aG vboxusers vbox

SELinux

放开对Headless Server 18083端口的限制

1
2
yum install policycoreutils-python
semanage port -a -t http_port_t -p tcp 18083

firewalld

1
2
3
firewall-cmd --permanent --zone=public --add-port=3389-4389/tcp
firewall-cmd --permanent --zone=public --add-port=18083/tcp
firewall-cmd --complete-reload

Windows VM 远程桌面加密

1
2
3
4
5
6
7
8
9
VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
VBoxManage modifyvm "Koi's Windows VM" --vrdeauthtype external

# 生成密码hash
VBoxManage internalcommands passwordhash "passwd"
adfasdfsdfasasdfasdfasdjhskadjhhasdlfjklsjdfkjlakasdfasdf

# 通过hash设置密码:用户名:koi   密码:passwd
VBoxManage setextradata "Koi's Windows VM" "VBoxAuthSimple/users/koi" adfasdfsdfasasdfasdfasdjhskadjhhasdlfjklsjdfkjlakasdfasdf

通过freerdp连接

1
xfreerdp /size:1280x1024 /bpp:32 +clipboard /sound /t:"Koi's Windows VM" /v:192.168.14.108:3389 /u:koi /p:passwd &