Subsystem kali install Desktop

Theoretically, all the Linux Win10 subsystem by Windows10 remote desktop machine and method of the present Xming to install using the graphical interface, the author is only in contact Debian Linux-based system, so as to Debian GNU / Linux system and to xfce4 Example introduction (Ubuntu system will be able to use Xming Bahrain, which will not be described in details, please pay attention to IT geeks College house, but this article is for the convenience of some friends have some experience with Linux written, do not like do not spray). In addition, if it is more, then use Linux, I recommend using a Debian system, stability, reliance stronger than Ubuntu and Kali Linux and so on.

First, the use of the machine remote desktop connection Windows10

1.1, first installed Debian

The specific process is no longer described, referring to the use of advanced IT House Win10: after the first anniversary of updates 14316 how to turn Linux Bash command line, install and set a password as follows:

1.2 The use of domestic software source

Well-known reasons, official sources in the country if you use it, update software, install the software will be very slow, very painful, we need to replace the domestic software source:

  • 1. Open the C in win10 Explorer: \ Users \ username \ AppData \ Local \ Packages \ TheDebianProject.DebianGNULinux_76v4gfsz19hv4 \ LocalState \ rootfs \ etc \ apt folder (replace username with your own win10 account name).

  • 2, edit sources.list file with the # comment out the original update official sources, increasing domestic sources. Below I posted a relatively stable source of stretch branch of USTC, software older, but stable. However, I personally use the buster branch, the software is relatively new, some strange things, Ubuntu default version with a lot of software is relatively new, so the stability of the system than Debian badly, wanted stability comrades on the use of the following sources it:

deb https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free

deb-src https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free

deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free

deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free

deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free

deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free

The author of this USTC heavyweights also released a tool, there are commonly used Linux distributions of domestic source file above, already set up for you to download: https: //mirrors.ustc.edu.cn/repogen/

3, finish editing save as:

1.3. Source Software Update

Code: sudo apt-get update

Note: There is a pit, because it is the https protocol, but the Win10 subsystem of Debian, and not apt-transport-https install, update will complain directly, it is recommended to first update using the http protocol or official sources in Bahrain after apt-transport-https, and then using 1.2 https protocol software source (Debian buster or more of the branch does not need the branch stable class must first install the software source apt-transport-https https protocol to use, using the https protocol effectively prevent operators hijacking).

End Update Figure:

1.4. Installing xorg

xorg是xfce桌面需要的一个基础依赖性质东西,开机时候提供登陆界面。这里我说的可能不太准确,个人理解就是要装xfce必须先安装xorg,不然使用起来会有些问题,比如缺少这个组件那个组件的,如果装Ubuntu桌面的话替换成kdm,xfce也可以先装xdm,看个人喜好。

代码:sudo apt-get install xorg

大约需要占用361M空间。

选择语言区域(建议选英文,选汉语也没用,就当学英语了),一路回车:

最后那行报错不用管,研究好些天都没解决掉,反正软件安装成功了。

1.5.安装xfce4

代码:sudo apt-get install xfce4

大概需要441M空间,如果不换国内源的话怕是需要下载一天。

1.6.安装并配置xrdp

Xrdp允许Windows或Linux系统通过远程桌面的方式来访问另外一台主机,特别适合本地虚拟机使用,详情参考Linux公社文章:xrdp完美实现Windows远程访问Ubuntu 16.04。

1、安装xrdp,代码:sudo apt-get install xrdp

2、设置使用3390端口

代码:sudo sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini

3、向xsession中写入xfce4-session

代码:sudo echo xfce4-session >~/.xsession

4、重启xrdp服务,代码:sudo service xrdp restart

这时,可能会有防火墙提示,允许就好。

1.7.启动远程桌面

1、在Cortana中搜索远程桌面并启动:

2、点击显示选项,填入本机IP(这里是局域网IP,所以你也可以用局域网内其他Windows10电脑试试,建议使用静态ip)、刚刚设置的端口号、还有你的Linux子系统用户名(也可以使用root账户登陆,比较麻烦,因为Debian默认是禁止使用root账户登陆的),如图:

3、点击链接:

4、输入Linux子系统密码:

5、尽情享(shí)用吧:

至于后面需要做的配置,参见:debian 9安装后需做的几件事

二、使用Xming及ssh连接

如果你用的Windows10子系统是Ubuntu,那安装完就能用了,很简单的详见IT之家相关教程,理论上所有Linux都可以通过本方法来实现安装,下面是Debian以及Kali Linux等系统需要做的配置,参考了:Use SSH and XMing to Display X Programs From a Linux Computer on a Windows Computer

首先需要安装Debian还有xfce4,与上面第一种方法述1.1至1.5的内容完全一致,在此不再赘述,安装好之后近些如下操作:

2.1.安装xming

没什么特殊的,下载安装,打开就行。

地址:https://xming.en.softonic.com/?ex=REG-60.2

2.2.确定OpenSSH已经安装

在终端执行:sudo apt-get install openssh-server

要是如下图这样,那就是没有安装,输入y确认就是了:

2.3.配置DISPLAY方法运行变量

安装完xming之后你会发现并不能像Ubuntu一样运行DISPLAY=:0 startxfce4指令来启动Debian的应用程序,提示找不到DISPLAY方法,那是没有配置ssh相关内容,我们需要做如下配置:

1、打开${HOME}/.bashrc文档,在最后面加入:

if [ -d "${HOME}/bin" ] ; then

export? PATH="${PATH}:${HOME}/bin"

if [ -f "${HOME}/bin/ssh_login" ] ; then

. "${HOME}/bin/ssh_login"

fi

fi

2、在${HOME}/bin/文件夹下新增ssh_login文件(bin文件夹没有就新建一个),内容如下:

if [ -n "${SSH_CLIENT}" ] ; then

if [ -z "${DISPLAY}" ] ; then

export DISPLAY='localhost:10'

fi

fi

3、给ssh_login文件777权限,代码:sudo chmod 777 ${HOME}/bin/ssh_login

2.4.在终端中启动xfce4桌面

如果你没有配置xming,没改里面东西,那默认实在0号显示器上显示Linux系统的程序,输入代码如下:

DISPLAY=:0 startxfce4

也可以直接启动root账户:

sudo su

DISPLAY=:0 startxfce4

默认状态会只有两个比较简陋的panel,如下图:

你也可以再进行拖动调整,比如笔者上面是Windows10的任务栏,下面是Debian的panel,结合到一起美滋滋:

其实正常状态下,还会启动一个桌面进程的,由于我用的是buster分支的软件源,这就导致软件不是最稳定版本,然后desktop启动失败,于是就剩下这两个panel,然而因祸得福,个人感觉这样很舒服,所以保留了这种,如果你用了我上面写的源,启动后的将会和前面的远程桌面类似。

三、Win10远程桌面与Xming连接的对比

其实实现原理都比较接近,都需要配置一系列东西,但两者体验还是有些不一样的,下面做个简要的对比:

1、安装难易度:

个人感觉,就Debian来讲使用xming的方式安装稍微简单一些,但二者相差不多,如果是Ubuntu,那会更加简单,各位可以自行体验。

2、启动便携度:

相同点是:两者都需要先在powershell或者cmd中先启动bash。

不同点是:远程桌面的方法启动bash后再启动远程桌面,只用配置一次,以后点击链接就可以,相当于每次启动需要鼠标点击一次powershell,输入bash,点击远程桌面,点击链接;

xming的方法需要再启动xming,然后在powershell里输入DISPLAY=:0 starxfce4,但是终端都会记录以前输入的内容,所以也不用每次都输入,其实就我个人而言,xming的方法更加方便启(zhuang)动(bi),哪怕每次都输入DISPLAY=:0 startxfce4。

使用远程桌面的方法启动后,可以关掉powershell了,只要后台服务在运行,就不会影响体验,但是xming不行,如果刚刚那个启动xfce4的powershell关掉,所有打开的窗口都会关闭。

3、使用体验:

采用远程桌面连接的方式,将会有非常完整的沉浸式体验,你会获得一个完整而不割裂的Linux系统,如在电脑上单独安了一个完整的Linux体验:

而使用xming的方法,你会感觉两个系统合二为一了,有种混血儿的感觉,每一个Linux程序都将会开启一个xming窗口,而且这些窗口也支持win10的分屏功能:

4、资源占用情况:在启动系统只开一个文件管理器的情况下,使用远程桌面的方法资源占用稍多,个人猜测可能是远程桌面本身占用的资源稍多一些,另外说一下,两者是可以同时打开的:

5、与Windows10系统的互通性:

文件互通性:两者都支持在两个系统下实时更改文件,但是都需要使用root账户登陆才能完全实现实时更改文档,不然在Windows10下的更改,在Linux下看不见,但在Linux下的更改立刻就能在Windows10上看到。

剪贴板互通性:两者都可以实现剪贴板文本内容的互通,但对于文件就有所不同。如使用远程桌面,文件的话由于两个系统的路径不同,无法从Windows10下粘贴文件到Linux下,如图:

但是可以从Linux下把文件粘贴到Windows10下的,比如粘贴到桌面,这是通过远程桌面本身实现的,如图:

而如果使用xming的话,只能文本互通,文件无法通过剪贴板复制粘贴,有时候还会有意外发生,需要清空剪贴板,比如笔者就在桌面上放了个

6、性能方面

The actual personal experience, poor performance xming ways, such as using Firefox, it tends to be more cards, which may be different implementations reasons, we tried to improve xming priority, not much use.

In summary, if you want a complete immersive experience of Linux, recommended use Remote Desktop Connection, if the main use or Windows10, Windows10 want to use while also using Linux, then I recommend using xming way, this way the two systems can be combined together to obtain a very magical experience. Here again, thank references under great God, with their dedication, we can learn more knowledge.

 

Original Address: ithome.com/html/win10/353700.htm

Guess you like

Origin www.cnblogs.com/Ai-Hen-Jiao-zhi/p/11538326.html