
下载地址
https://qemu.weilnetz.de/w64/qemu-w64-setup-20251217.exe


知乎教程
https://zhuanlan.zhihu.com/p/679415673?share_code=1bYU3dnXaC0uJ&utm_psn=2010998116350963821


cmd 命令行里
创建磁盘
qemu-img create -f qcow2 D:\wyc\QEMU\kylin\Kylin.img 100G


打开虚拟机
桥接网络时候,qemu机器要配置默认网关是宿主机tap0网卡的ip,还要配置dns服务器8.8.8.8

# 桥接网络
 "C:\Program Files\qemu\qemu-system-aarch64.exe" ^
 -M virt ^
 -cpu cortex-a72 ^
 -smp 16 ^
 -m 16G ^
 -bios "C:\Program Files\qemu\share\edk2-aarch64-code.fd" ^
 -drive if=none,file="D:\wyc\QEMU\kylin\Kylin.img",id=hd0 ^
 -device virtio-blk-device,drive=hd0 ^
 -device virtio-gpu-pci ^
 -device qemu-xhci ^
 -device usb-tablet ^
 -device usb-kbd ^
 -display default ^
 -k en-us ^
 -netdev tap,id=n1,ifname=tap0,script=no,downscript=no ^
 -device virtio-net-device,netdev=n1

# 端口映射
"C:\Program Files\qemu\qemu-system-aarch64.exe" ^
 -M virt ^
 -cpu cortex-a72 ^
 -smp 16 ^
 -m 16G ^
 -bios "C:\Program Files\qemu\share\edk2-aarch64-code.fd" ^
 -drive if=none,file="D:\wyc\QEMU\kylin\Kylin.img",id=hd0 ^
 -device virtio-blk-device,drive=hd0 ^
 -device virtio-gpu-pci ^
 -device qemu-xhci ^
 -device usb-tablet ^
 -device usb-kbd ^
 -display default ^
 -k en-us ^
 -netdev user,id=n1,hostfwd=tcp::2222-:22,hostfwd=tcp::3333-:3389,hostfwd=tcp::5902-:5901,hostfwd=tcp::1235-:1234 ^
 -device virtio-net-device,netdev=n1



// 装系统加上
 -drive if=none,file="D:\wyc\iso\Kylin-Desktop-V10-SP1-2403-Release-20240430-arm64.iso",id=cdrom,media=cdrom ^
 -device virtio-scsi-device ^
 -device scsi-cd,drive=cdrom ^


安装ssh

sudo apt install -y openssh-server nano rsync flex bison  texinfo gawk net-tools rsync zsh libncurses-dev libtinfo-dev ncurses-term zstd unrar
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt install -y cmake build-essential git pkg-config ninja-build gdb linux-tools-common linux-tools-generic linux-tools-$(uname -r)  valgrind
sudo apt install -y gsettings-desktop-schemas
sudo apt install -y mingw-w64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64
sudo apt install -y $(apt-cache search '^libqt5.*-dev$' | awk '{print $1}')
sudo apt install -y python3 python3-dev python3-pip python3-venv python3-setuptools python3-wheel python3-distutils pkg-config


ssh时候，需要在kylin系统界面端点击允许连接
单向ping通，反向ping不通很可能是防火墙的问题


ibus-setup


安装qt
sudo apt install -y $(apt-cache search '^libqt5.*-dev$' | awk '{print $1}') qtbase5-dev qttools5-dev qttools5-dev-tools qt5-qmake qtchooser qtcreator



开启x11转发
sudo nano /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
sudo systemctl restart ssh
然后ssh进入 显示出下列证明成功
ys@cetc52-pc:~$ echo $DISPLAY
localhost:10.0
clion 程序配置加上环境变量 DISPLAY=localhost:10.0;QT_QPA_PLATFORM=xcb
建立 X11 转发的 SSH 用户 和 实际启动 GUI 程序的用户 要使用同一个用户




安装xrdp (xrdp )
sudo apt update
sudo apt install -y xrdp
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
sudo systemctl enable xrdp
sudo systemctl status xrdp



ubuntu20.04 安装交叉到arm的交叉编译器
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu


安装vnc （未完成）
sudo apt install tigervnc-standalone-server tigervnc-common
设置 VNC 密码
vncpasswd
nano ~/.vnc/xstartup
