Skip to content

Instantly share code, notes, and snippets.

@newrerio
Last active October 6, 2021 10:57
Show Gist options
  • Save newrerio/67393349616bbda3451f3248133261a7 to your computer and use it in GitHub Desktop.
Save newrerio/67393349616bbda3451f3248133261a7 to your computer and use it in GitHub Desktop.
# 修改软件源 ubuntu 20.04 lts
https://howto.azureedge.net/how-to-run-macos-on-kvm-qemu/#:~:text=In%20order%20for%20you%20to%20run%20macOS%20on,virtinst%20libvirt-daemon-system%20virt-manager.%20Secure%20the%20Vhost_net%20The%20
# 首先备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
#安装ssh
sudo apt-get install openssh-server
sudo service ssh start
#安装图形界面2
sudo apt install ubuntu-desktop
输入以下命令(每次启动最好重启下dbus服务),就可以显示桌面画面
sudo service dbus restart
DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0 XDG_SESSION_TYPE=x11 gnome-session
在.bashrc文件中导入,这样只需要输入 gnome-session 就能进行连接
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
export XDG_SESSION_TYPE=x11
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 # in WSL 2
export LIBGL_ALWAYS_INDIRECT=1
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
export XDG_SESSION_TYPE=x11
DISPLAY=$(192.168.0.1):0 XDG_SESSION_TYPE=x11 gnome-session
# hyper-v 安装 manjaro
注意:该步骤安装显卡驱动仅仅针对当前系统,因此对于 LiveCD 和硬盘版系统各需要执行一次
关闭具体虚拟机设置里的安全启动
启动,选择后等待卡住
使用 ctrl + alt + f1/f2/f3 进入 tty
pacman -Sy 升级系统
pacman -S xf86-video-fbdev 安装正确驱动
如果是 xfce,则 sudo systemctl start lightdm
如果是 kde,sudo systemctl start sddm(备选 ctrl + alt + f7 或者 startx)则可能需要完全更新系统
systemctl set-default multi-user.target 可切换到多人启动,systemctl set-default graphical.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment