docker kali 安装 xfce4 桌面 + tigervnc + novnc
- 启动容器
- 环境变量
- 准备工作
- 安装xfce4 桌面
- tigervnc
-
- novnc
- xfce4 启动弹窗如何关闭?
- 参考
启动容器
docker run --name kali -p 5901:5901 -p 6080:6080 -i -t kalilinux/kali-rolling
环境变量
export DISPLAY=:1
export VNC_PORT=5901
export NOVNC_PORT=6080
准备工作
kali 官方源比较慢,这里修改成中科大的源。
echo "deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib" > /etc/apt/sources.list
apt update
apt install -y wget
安装xfce4 桌面
apt-get --yes dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get --yes install kali-desktop-xfce
tigervnc
安装 tigervnc
apt install -y tigervnc-standalone-server
启动 tigervnc
xstartup 文件内容
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
export SHELL=/bin/bash
startxfce4 &
经过测试 xstartup 文件不能直接使用,需要将最后的 “&” 删掉。tigervnc 启动时会执行上述脚本,自动启动 xfce4 桌面。
mkdir -p ~/.vnc/
wget https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-project/-/raw/master/nethunter-fs/profiles/xstartup -O ~/.vnc/xstartup
chmod +x ~/.vnc/xstartup
sed -i "s/startxfce4 &/startxfce4/" ~/.vnc/xstartup
echo "your password" | vncpasswd -f >> ~/.vnc/passwd
vncserver $DISPLAY -rfbport $VNC_PORT -localhost no -PasswordFile ~/.vnc/passwd
- -rfbport:vnc 的端口号
- -localhost:同一时间默认只允许一个 vnc viewer 连接,可添加 -shared 选项以允许多个 vnc viewer 同时连接
- -PasswordFile:密码文件路径
使用 vnc viewer 连接 127.0.0.1:5901
novnc
apt install -y novnc
/usr/share/novnc/utils/novnc_proxy --vnc localhost:$VNC_PORT --listen $NOVNC_PORT
使用浏览器访问 novnc 主页 127.0.0.1:6080/vnc.html
xfce4 启动弹窗如何关闭?
apt purge -y xfce4-power-manager-plugins
参考
- Setting up RDP with Xfce | Kali Linux Documentation
- Kali In The Browser (Guacamole) | Kali Linux Documentation
- Kali In The Browser (noVNC) | Kali Linux Documentation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)