Windows10内嵌Ubuntu子系统初始化设置

   2023-02-10 学习力0
核心提示:重启ubuntuSince Windows 10 version 1803, closing all WSL terminal windows won't kill background processes by default, unless the file /var/run/reboot-required is present. This file will be automatically created by apt on Ubuntu when an upda

Windows10内嵌Ubuntu子系统初始化设置

重启ubuntu

Since Windows 10 version 1803, closing all WSL terminal windows won't kill background processes by default, unless the file /var/run/reboot-required is present. This file will be automatically created by apt on Ubuntu when an update requires a reboot, but if you want to manually reboot the subsystem, you can create the file yourself:

sudo touch /var/run/reboot-required

然后关闭ubuntu的shell框就相当于关机。

I haven't tested this on other distributions available in the Microsoft Store. An alternative solution is to kill all processes yourself:

sudo killall -r '.*'

重置ubuntu,相当于重新安装

Windows10内嵌Ubuntu子系统初始化设置

Windows10内嵌Ubuntu子系统初始化设置

配置ubuntu镜像源

阿里源地址为:https://opsx.alibaba.com/mirror?lang=zh-CN,找到ubuntu镜像的帮助,根据提示修改/etc/apt/sources.list,然后执行sudo apt-get update。

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

图形化界面

  1. 更新

    sudo apt-get update
    
  2. 开始安装图形化界面

    sudo apt-get install xorg
    sudo apt-get install xfce4
    sudo apt-get install xrdp
    
  3. 配置远程端口为3390

    sudo sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini
    
  4. 向xsession中写入xfce4-session

    sudo echo xfce4-session >~/.xsession
    
  5. 重启xrdp服务

    sudo service xrdp restart
    
  6. 如果有防火墙,允许就好了。

  7. 在Cortana中搜索远程桌面连接,点击进入,输入本机IP:端口,以及子系统用户名(在步骤2中,终端窗口@符号之前)

Windows10内嵌Ubuntu子系统初始化设置

Windows10内嵌Ubuntu子系统初始化设置

  1. 登陆成功,显示Ubuntu的图形界面。

踩过的坑:我的win10和ubuntu的用户名相同,都是我的姓名全拼。使用远程桌面登陆时,连接成功后闪退,后来改用root登陆就可以了。

安装docker

ubuntu版本为16.04

  1. 使用阿里云的镜像
  2. 使用阿里云的docker镜像
  3. 安装后,使用sudo service docker start启动docker服务失败了,重启之后有start了两次就可以了。
   # step 1: 安装必要的一些系统工具
   sudo apt-get update
   sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
   # step 2: 安装GPG证书
   curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
   # Step 3: 写入软件源信息
   sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
   # Step 4: 更新并安装 Docker-CE
   sudo apt-get -y update
   sudo apt-get -y install docker-ce
   
   # 安装指定版本的Docker-CE:
   # Step 1: 查找Docker-CE的版本:
   # apt-cache madison docker-ce
   #   docker-ce | 17.03.1~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
   #   docker-ce | 17.03.0~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
   # Step 2: 安装指定版本的Docker-CE: (VERSION 例如上面的 17.03.1~ce-0~ubuntu-xenial)
   # sudo apt-get -y install docker-ce=[VERSION]

Windows10内嵌Ubuntu子系统初始化设置

磁盘映射

在ubuntu内部,可以进入/mnt/c等目录,操作windows10的多个磁盘。
Windows10内嵌Ubuntu子系统初始化设置

 
反对 0举报 0 评论 0
 

免责声明:本文仅代表作者个人观点,与乐学笔记(本网)无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
    本网站有部分内容均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责,若因作品内容、知识产权、版权和其他问题,请及时提供相关证明等材料并与我们留言联系,本网站将在规定时间内给予删除等相关处理.

  • Ubuntu使用——15(thinkphp路由报错Non-static method think\Route::get() should not be called statically)
    Ubuntu使用——15(thinkphp路由报错Non-static
    在route.php中添加代码:use think\Route;Route::get('/',function (){return 'hello world';});在浏览器中输入http://localhost/tp5-git/public/index.php,报错:[8192] ErrorException in route.php line 13Non-static method think\Route::get() should n
    03-08
  • Ubuntu与Window双系统安装的注意事项
    Ubuntu与Window双系统安装的注意事项
      UBUNTU与WINDOW双系统安装的注意事项 由 匿名 (未验证) 提交于 2019-05-18 10:07:41登录 发表评论29 次浏览假定电脑里面已经存在了Window系统,安装另外一个Linux系统:第一:首先确定电脑里面的window系统引导方式电脑系统的引导方式分为:(1)传统
    03-08
  • Ubuntu 图形界面损坏修复方法!!!亲测有用!!!
    Ubuntu 图形界面损坏修复方法!!!亲测有用!
    1.现象今天做实验的时候打开Ubuntu虚拟机,输入密码之后发现变成这样:然后重新开机,到了输入密码界面不输入,而是输入快捷键CTRL+alt+F1,输入用户名+密码进入之后输入ls,发现我的文件还在,心想这不是系统炸了啊上网搜说是图形界面损坏于是重新来:(参考
    03-08
  • Ubuntu终端输入异常、无法退格(删除文本)、使用方向键命令
    Ubuntu终端输入异常、无法退格(删除文本)、使
    1 起因为了学习嵌入式开发安装去安装的ncurses库,使用命令:sudo apt-get install libncurses5-dev导致系统自带的ncurses-base被自动删除。2 出现的问题误删ncurses-base后导致终端输入窗口出现了一系列的问题:Ubuntu终端输入无法退格(删除文本)、使用↑
    03-08
  • Raspberry Pi (Ubuntu) 上的 VNC 无监视器
    Raspberry Pi (Ubuntu) 上的 VNC 无监视器
    超级方便的无监视器VNC方便的树莓派远程桌面操作,无需显示器\(^^)/通过在页面末尾设置“无显示器设置”,可以在启动树莓派之前和之后连接和断开 HDMI 显示器电缆(这很重要)。来自主 PC 的远程桌面环境树莓派 4Ubuntu 20.04(64位)服务器+桌面设置VNC 设
    03-08
  • 免费供个人使用最多3个! !我尝试注册 ESM 将 Ubuntu LTS 版本的支持期延长 5 年
    免费供个人使用最多3个! !我尝试注册 ESM 将
    我个人使用 Ubuntu 作为我的 Linux 机器的操作系统。 Ubuntu 有正常版本和 LTS(长期支持)版本的操作系统。至此,版本号奇数为普通版,偶数为LTS版,LTS版长期支持5年,而普通版有支持期半年左右。。由于Linux机器用作GPU服务器,由于驱动程序和库的兼容性等
    03-08
  • [WSL2 Ubuntu22.04] 尝试使用 WSLg 运行 Elixir Desktop(未完成)
    [WSL2 Ubuntu22.04] 尝试使用 WSLg 运行 Elixir
    现状启用 WSLg 后,Elixir Desktop 会不会像在 Ubuntu 上一样工作?Elixir 桌面示例我试着跑步窗口显示并似乎在移动,但 Todo 应用程序未显示在窗口中。这是一个空白的显示。显示窗口和菜单。Extra 的内容也可以单独使用。如果您使用 Extra 的 Open Browser
    03-08
  • ubuntu中vi下删除键和上下左右键输入字符异常(
     刚安装的Ubuntu系统,使用vi编辑文本的时候,出现以下现象:点删除键输入了 D回车无效上下左右为字母光标乱跳 原因:自带的vi功能问题 解决:卸载原有vi,重新安装完整版本vim执行以下命令即可: sudo apt-get remove vim-common sudo apt-get install v
    02-10
  • ubuntu禁止ping操作(禁用ICMP协议访问) icmp
    ping命令是计算机之间进行相互检测线路完好的一个应用程序,计算机间交流数据的传输没有经过任何的加密处理,因此我们在用ping命令来检测某一个服务器时,可能在因特网上存在某个非法分子,为了安全我们把ping给禁止掉。通过专门的黑客程序把在网络线路上传输
    02-10
  • Ubuntu16配置静态IP ubuntu16.04配置静态ip
    一、静态IP地址配置sudo vi/etc/network/interfaces然后按照如下格式修改:注意这里的网卡名字是ens33auto loiface lo inet loopbackauto ens33iface ens33 inet staticaddress 192.168.1.106netmask 255.255.255.0gateway 192.168.1.1二、配置DNS#临时修改su
    02-10
点击排行