Zynq research and development (1) - Win10 subsystem installed Linux (Ubuntu)

1. Search and open the "Enable Windows features on or off" in the "All Settings", select the "Windows subsystem for Linux" entry, reboot the system

2. Obtain and install Ubuntu through the Microsoft Store. First start Ubuntu, there will be an installation process, you need to set UNIX user name and password, enter the user name and password z z

Description: Ubuntu file subsystem actually set path

C:\Users\{username}\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

Query Ubuntu system currently installed version, you can enter the following command:

lsb_release -a

The current version of this article was 18.04

3. Run Ubuntu subsystems: Run the main menu in win10

4. Set the Chinese language environment, the main purpose is to display Chinese folder and file names

Install Chinese language pack:

sudo apt install -y language-pack-zh-hans language-pack-zh-hans-base

Set the localization environment variables:

echo "LANG=zh_CN.UTF-8" >> ~/.profile

Reopen Ubuntu, complete set

The graphical interface is provided

One method is to load the GUI inside Ubuntu direct, one is sampling remote desktop mode. Linux systems since much research for the role Zynq, thus taking the latter to reduce the volume of the installation tool (about 2G). The former method can be found here

First update under subsystem:

sudo apt-get update
sudo apt-get upgrade

Install xorg

sudo apt-get install xorg

Install xfce4

sudo apt-get install xfce4

Installation xrdp

sudo apt-get install xrdp

Xrdp port configuration, port number is 3390

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

Xfce4-session to write in xsession

sudo echo xfce4-session >~/.xsession

Restart xrdp Service

sudo service xrdp restart

If you have a firewall, allowing just fine.

Note: Each computer must first start after boot xrdp in the terminal before the remote connection, start a terminal window can be closed. Or set at startup

6. Set the simulator program to support the 32bit

Since the use of the back Arm Xilinx Linux compiler is a 32bit, Zynq running application is 32bit, and 64bit version of Ubuntu subsystem, install qemu-user-i386 emulator allows 64-bit Ubuntu 32bit program of support

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 zlib1g-dev:i386
# for wsl
sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
sudo service binfmt-support start

7.  运行远程桌面

在远程桌面连接窗口,输入本机IP和端口号(之前设置的3390),以及子系统用户名(z),然后连接,进入Ubuntu图形界面

在文件系统(Filesystem)窗口里的mnt就是宿主机的“我的电脑”,c、d、e等子目录就是各个磁盘盘符

在某个磁盘下设置linux的工作目录zynq_work

要修改桌面大小,可以在远程连接窗口“显示”项中选择。

到此完成Ubuntu的系统建设。

注:也可以用虚拟机实现Zynq研发的Linux编译环境(已经验证,见下图),本笔记尝试用Linux子系统实现功能需求。

 

补充说明:

在后续linux编译中发现,原本虚拟机方式只需要几分钟就可以完成的编译工作,在linux子系统中却超过1小时还未能编译结束。可能的原因是, WSL(Windows Linux子系统)必须在64bit的Win10使用,加载的Linux系统(比如Ubuntu)也是64bit版本。而研发的Linux是32bit系统,虽然可以用i386模拟器工作,但效率太差了。结论,放弃Linux子系统方式,还是用虚拟机安装32bit的Ubuntu14.04工作。

当然,对于可以使用Linux 64bit版本工作的场合,还是WSL比较方便。

Guess you like

Origin blog.csdn.net/mcubbs/article/details/82430938