From de04fa8774ca9b3956b8b6279e234ed81f648714 Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Tue, 19 Sep 2023 17:58:00 +0800 Subject: [PATCH] vault backup: 2023-09-19 17:58:00 --- 07-Other/Qt/使用WSL安装Ubantu来测试Qt.md | 40 ++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/07-Other/Qt/使用WSL安装Ubantu来测试Qt.md b/07-Other/Qt/使用WSL安装Ubantu来测试Qt.md index 625e610..add8da6 100644 --- a/07-Other/Qt/使用WSL安装Ubantu来测试Qt.md +++ b/07-Other/Qt/使用WSL安装Ubantu来测试Qt.md @@ -1,7 +1,7 @@ # 前言 参考: -- https://zhuanlan.zhihu.com/p/621142457 -- https://www.bilibili.com/read/cv11143517/ +- 2023最新WSL搭建深度学习平台教程:https://zhuanlan.zhihu.com/p/621142457 +- WSL2 + Ubuntu + 图形界面安装:https://www.bilibili.com/read/cv11143517/ - https://zhuanlan.zhihu.com/p/150555651 # 安装 @@ -11,15 +11,27 @@ https://learn.microsoft.com/zh-cn/windows/wsl/install-manual#step-4---download-t - wsl --set-default-version 2 - +## 安装Ubuntu - 在Micrsoft Store中搜索Ubantu22.04并且安装 -- 之后运行Ubantu22.04会报错:报错WslRegisterDistribution failed with error: 0x8007019e +- 之后运行Ubuntu22.04会报错:报错WslRegisterDistribution failed with error: 0x8007019e - 以管理员模式运行PowerShell并且运行Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -- 重启后运行Ubantu22.04即可安装 +- 重启后运行Ubuntu22.04即可安装 ## 桌面安装 +https://blog.csdn.net/weixin_44478077/article/details/128723158 1. sudo apt-get intall xrdp 2. sudo apt-get intall xubuntu-desktop +3. sudo apt-get install ubuntu-desktop +4. sudo service dbus restart +5. 执行`sudo vi ~/.bashrc`编辑用户设置,vi按i插入: +``` +export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0 + +export XDG_SESSION_TYPE=x11 +``` +保存后执行`source ~/.bashrc`生效。 + +6. 保证VcXsrv启动状态下,输入gnome-session ```bash echo xfce4-session >~/.xsession @@ -27,4 +39,20 @@ sudo service xrdp restart Restarting Remote Desktop Protocol server [20190719-15:20:51] [DEBUG] Testing if xrdp can listen on 0.0.0.0 port 3390. [20190719-15:20:51] [DEBUG] Closed socket 6 (AF_INET6 :: port 3390) -``` \ No newline at end of file +``` + +# 进入wsl + + +# Hyper-V +## 设置分辨率 +1.  **sudo vi /etc/default/grub** 找到‘GRUB_CMDLINE_LINUX_DEFAULT’配置, 添加 ‘video=hyperv_fb:[你自己的分辨率值]’。 比如我的是1920x1080. 所以改完后的结果为:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080" +2. 保存并退出vi. +3. 运行:**sudo update-grub** +4. 重启虚拟机:**sudo reboot** +# 安装Qt + + +# 问题解决 +- WslRegisterDistribution failed with error: 0x8037010d + - 管理员模式运行PowerShell执行dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart \ No newline at end of file