qq群推广用什么网站好,旅游网络营销案例,个人博客模板wordpress,贵阳网络推广哪家专业上一篇帖子记录了ACRN运行rt linux#xff0c;这篇帖子记录一下最近倒腾出来的WIN10。目前架构如下 ACRN可以把它理解为一个基于Linux类似软件的Type1 Hypervisor#xff0c;基于Linux去做而不是baremetal是为了更方便去配置资源。
首先我们得有两台电脑#xff0c;一台是开…上一篇帖子记录了ACRN运行rt linux这篇帖子记录一下最近倒腾出来的WIN10。目前架构如下 ACRN可以把它理解为一个基于Linux类似软件的Type1 Hypervisor基于Linux去做而不是baremetal是为了更方便去配置资源。
首先我们得有两台电脑一台是开发机另一台是目标机
开发机
主要用于编译ACRN_hypervisor和ACRN_kernel 另外建议目标机使用intel的ECI-Jammy基于ubuntu魔改的core-jammy — ECI documentation (intel.com) 目前版本应该在3.1
目标机
运行ACRN_Service_VM以及guest_VMs
我这边用的是cpu为12代i7的目标机制作WIN10启动镜像需要用到OVFM.FD这个是按intel的cpu代数区分的所以不是很通用。
Step1 环境配置
首先进入目标机的BIOS修改下面的选项PM Support是8代core才有的所以不用管 然后我的建议是使用ECI--jammy作为目标机的操作系统core-jammy — ECI documentation (intel.com)
虽然ACRN官方文档用的是Ubuntu22.04但是我推荐ECI-Jammy理由如下
1.ECI-Jammy基于ubuntu魔改有intel优化而且还支持apt-get
2.ECI-Jammy有intel的仓库有运动控制库
3.ECI-Jammy自带intel基于cpu优化过的preempt-rt
4.ECI-Jammy会生成.img镜像可以直接给ACRN的rt_vm当做镜像用 假设你用的是ECI由于默认的静态ip设置会和ACRN的冲突一个是networking脚本配置一个是systemd-networkd管理所以我们要统一一下开机后 如果用ECI的话请把eci-user加入sudoers$ su$ nano /etc/sudoersroot ALL(ALL:ALL) ALLeci-user ALL(ALL:ALL) ALL$ :wqsource /home/eci-user/.bashrc
$ sudo apt update
$ cd /etc/network
$ rm interfaces$ cd /etc/systemd/network$ touch 20-static.network$ nano 20-static.network[Match]
Nameenp4s0
[Network]
Address192.168.8.89
Gateway192.168.8.1
DNS8.8.8.8
DNS8.8.4.4[DHCP]
UseDNSfalse$ sudo systemctl enable systemd-networkd
$ sudo systemctl restart systemd-networkd 按照官方文档配置好开发机
Getting Started Guide — Project ACRN™ 3.3 documentation
插上USB键盘鼠标生成my_board当生成my_board.xml后我们要使用acrn_configurator去生成配置然后编译acrn_hypervisor和acrn_kernel。
ACRN Configurator Tool — Project ACRN™ 3.4-unstable documentation
在acrn_configurator中找到VM0改名成ACRN_Service_VM并在内核命令中设置i915.modeset0
在acrn_configurator中创建一个WIN10的VM把PCI里的VGA传递进去在USB里把我们的鼠标键盘也传递进去
按照文档编译 ACRN_hypervisor和ACRN_kernel 然后安装到目标机上
开机后选择带有VM标识的启动项
不出意外你应该 卡在这个界面这是因为我们modeset0以后显示器不会显示console了因为WIN10要用到。
Step2 三个东西
不要担心我们还是能通过ssh的方式连接上的 ssh eci-user192.168.8.89 然后我们要准备三个东西
1. Windows10.iso
下载 Windows 10一定要从这里下载安装器然后选择USB介质下载Windows10.iso大概4.7G不要去下三方的雨木林风什么的识别不到的
2.winvrito
这个是oracle的一个虚拟化驱动https://edelivery.oracle.com/osdc/faces/SoftwareDelivery在这个网站注册然后选择Download Package.输入 Oracle Linux 7.6 并点击 Search.
选择DLP: Oracle Linux 7.6 点击continue
选择x86-64-bit
右键该项选择另存为解压后得到 winvrito 3.OVMF.fd
这部分的连接在此但是无法完全根据上面的内容进行操作就是了
Enable GPU Passthrough (GVT-d) — Project ACRN™ 3.4-unstable documentation
打开你的开发机安装docker(请自行安装这里不做说明)
$ cd ~
$ git clone https://github.com/projectacrn/acrn-edk2.git$ docker pull ubuntu:16.04 网页提供了一个脚本我也放在这里
#!/bin/bash
# Copyright (C) 2021 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
#
# PREREQUISITES:
# 1) Get your specific IntelGopDriver.efi and Vbt.bin
# from your BIOS vender
# 2) Install Docker on your host machine and allow non-root users
# For Ubuntu: https://docs.docker.com/engine/install/ubuntu/
# To enable non-root users: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
# 3) If you are working behind proxy, create a file named
# proxy.conf in ${your_working_directory} with
# configurations like below:
# Acquire::http::Proxy http://x.y.z:port1;
# Acquire::https::Proxy https://x.y.z:port2;
# Acquire::ftp::Proxy ftp://x.y.z:port3;
#
# HOWTO:
# 1) mkdir ${your_working_directory}
# 2) cd ${your_working_directory}
# 2) mkdir gop
# 3) cp /path/to/IntelGopDriver.efi /path/to/Vbt.bin gop
# 4) cp /path/to/build_acrn_ovmf.sh ${your_working_directory}
# 5) ./build_acrn_ovmf.sh
#
# OUTPUT: ${your_working_directory}/acrn-edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
#
# For more information, ./build_acrn_ovmf.sh -h
#gop_bin_dir./gop
docker_image_nameubuntu:ovmf.16.04
proxy_confproxy.conf
acrn_verlatestif [ ! -x $(command -v docker) ]; thenecho Install Docker first:echo If you are using Ubuntu, you can refer to: https://docs.docker.com/engine/install/ubuntu/exit
fiif [ ! -d ${gop_bin_dir} ]; thenmkdir ${gop_bin_dir}echo Copy IntelGopDriver.efi and Vbt.bin to ${gop_bin_dir}exit
fiif [ ! -f ${gop_bin_dir}/IntelGopDriver.efi ]; thenecho Copy IntelGopDriver.efi to ${gop_bin_dir}exit
fiif [ ! -f ${gop_bin_dir}/Vbt.bin ]; thenecho Copy Vbt.bin to ${gop_bin_dir}exit
fiif [ ! -f ${proxy_conf} ]; thentouch ${proxy_conf}
fiusage()
{echo $0 [-v ver] [-i] [-s] [-h]echo -v ver: The release version of ACRN, e.g. 2.3echo -i: Delete the existing docker image ${docker_image_name} and re-create itecho -s: Delete the existing acrn-edk2 source code and re-download/re-patch itecho -h: Show this helpexit
}re_download0
re_create_image0while getopts hisv: opt
docase ${opt} inh)usage;;i)re_create_image1;;s)re_download1;;v)acrn_ver${OPTARG};;?)echo ${OPTARG};;esac
done
shift $((OPTIND-1))if [[ ${re_create_image} -eq 1 ]]; thenif [[ $(docker images -q ${docker_image_name} 2 /dev/null) ! ]]; thenecho echo Deleting the old Docker image ${docker_image_name} ...echo docker image rm -f ${docker_image_name}fi
fiif [[ ${re_download} -eq 1 ]]; thenecho echo Deleting the old acrn-edk2 source code ...echo sudo rm -rf acrn-edk2
ficreate_acrn_edk2_workspace()
{echo echo Downloading patching acrn_edk2 source code ...echo [ -d acrn-edk2 ] sudo rm -rf acrn-edk2git clone https://github.com/projectacrn/acrn-edk2.gitif [ $? -ne 0 ]; thenecho git clone acrn-edk2 failedreturn 1ficd acrn-edk2git submodule update --init CryptoPkg/Library/OpensslLib/opensslif [ $? -ne 0 ]; thenecho git submodule acrn-edk2 failedreturn 1fiif [ ${acrn_ver} ! latest ]; thengit checkout --recurse-submodules -b v${acrn_ver} ovmf-acrn-v${acrn_ver}if [ $? -ne 0 ]; thenecho git checkout --recurse-submodules -b v${acrn_ver} ovmf-acrn-v${acrn_ver} failedreturn 1fifiwget -q https://projectacrn.github.io/${acrn_ver}/_static/downloads/Use-the-default-vbt-released-with-GOP-driver.patchif [ $? -ne 0 ]; thenecho Downloading Use-the-default-vbt-released-with-GOP-driver.patch failedreturn 1fiwget -q https://projectacrn.github.io/${acrn_ver}/_static/downloads/Integrate-IntelGopDriver-into-OVMF.patchif [ $? -ne 0 ]; thenecho Downloading Integrate-IntelGopDriver-into-OVMF.patch failedreturn 1figit am --keep-cr Use-the-default-vbt-released-with-GOP-driver.patchif [ $? -ne 0 ]; thenecho Apply Use-the-default-vbt-released-with-GOP-driver.patch failedreturn 1figit am --keep-cr Integrate-IntelGopDriver-into-OVMF.patchif [ $? -ne 0 ]; thenecho Apply Integrate-IntelGopDriver-into-OVMF.patch failedreturn 1fireturn 0
}create_docker_image()
{echo echo Creating Docker image ...echo cat Dockerfile.ovmf EOF
FROM ubuntu:16.04WORKDIR /root/acrnCOPY ${proxy_conf} /etc/apt/apt.conf.d/proxy.conf
RUN apt-get update apt-get install -y vim build-essential uuid-dev iasl git gcc-5 nasm python-dev
EOFdocker build -t ${docker_image_name} -f Dockerfile.ovmf .rm Dockerfile.ovmf
}if [[ $(docker images -q ${docker_image_name} 2 /dev/null) ]]; thencreate_docker_image
fiif [ ! -d acrn-edk2 ]; thencreate_acrn_edk2_workspaceif [ $? -ne 0 ]; thenecho Download/patch acrn-edk2 failedexitfi
elsecd acrn-edk2
ficp -f ../${gop_bin_dir}/IntelGopDriver.efi OvmfPkg/IntelGop/IntelGopDriver.efi
cp -f ../${gop_bin_dir}/Vbt.bin OvmfPkg/Vbt/Vbt.binsource edksetup.shsed -i s:^ACTIVE_PLATFORM\s*\s*\w*/\w*\.dsc*:ACTIVE_PLATFORM OvmfPkg/OvmfPkgX64.dsc:g Conf/target.txt
sed -i s:^TARGET_ARCH\s*\s*\w*:TARGET_ARCH X64:g Conf/target.txt
sed -i s:^TOOL_CHAIN_TAG\s*\s*\w*:TOOL_CHAIN_TAG GCC5:g Conf/target.txtcd ..docker run \-ti \--rm \-w $PWD/acrn-edk2 \--privilegedtrue \-v $PWD:$PWD \${docker_image_name} \/bin/bash -c source edksetup.sh make -C BaseTools build -DFD_SIZE_2MB -DDEBUG_ON_SERIAL_PORTTRUE这时候你会发现根据网页的内容无论是一种方式还是第二种都会报错
第一种因为gcc不是gcc-5 第二种不知道为什么就报错了 这时候你得创建这个docker然后step by step之前运行脚本后会生成一个ubuntu:ovmf.16.04的docker镜像首先自己创建该镜像然后准备好你的Vbt.bin和IntelGopDriver.efi以及网页里提到的两个patch Use-the-default-vbt-released-with-GOP-driver.patch Integrate-IntelGopDriver-into-OVMF.patch $ sudo docker create -it ubuntu:ovmf.16.04
$ docker start container_id$ cd ~
$ docker cp acrn-edk2 container_id:~/
$ docker cp Vbt.bin container_id:~/
$ docker cp IntelGopDriver.efi container_id:~/
$ docker cp Use-the-default-vbt-released-with-GOP-driver.patch container_id:~/
$ docker cp Integrate-IntelGopDriver-into-OVMF.patch container_id:~/$ docker exec -it container_id /bin/bash
$ cd ~
$ cp Use-the-default-vbt-released-with-GOP-driver.patch ./acrn-edk2
$ cp Integrate-IntelGopDriver-into-OVMF.patch ./acrn-edk2
$ cd acrn-edk2/OvmfPkg/
$ mkdir IntelGop
$ mkdir Vbt
$ cd ~
$ cp IntelGopDriver.efi acrn-edk2/OvmfPkg/IntelGop/IntelGopDriver.efi
$ cp Vbt.bin acrn-edk2/OvmfPkg/Vbt/Vbt.bin
$ cd acrn-edk2
$ git apply Use-the-default-vbt-released-with-GOP-driver.patch
$ git apply Integrate-IntelGopDriver-into-OVMF.patch
$ cd acrn-edk2
$ git submodule update --init CryptoPkg/Library/OpensslLib/openssl
$ source edksetup.sh
$ make -C BaseTools
$vim Conf/target.txtACTIVE_PLATFORM OvmfPkg/OvmfPkgX64.dscTARGET_ARCH X64TOOL_CHAIN_TAG GCC5$build -DFD_SIZE_2MB -DDEBUG_ON_SERIAL_PORTTRUE 编译完成后在这个路径下能找到Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
Step3 安装win10
参考Run Windows as the User VM OS — Project ACRN™ 3.4-unstable documentation
在目标机上
$ cd ~
$ mkdir work
$ sudo apt-get install qemu-utils
$ cd ~/work
$ qemu-img create -f raw win10-ltsc.img 40G
现在把Window.iso和OVMF.fd以及winvirtio.iso都拷贝到work目录下目录结构如下所示这里launch_user_vm_id2.sh是我们acrn_configurator生成的一个脚本我们还要修改一下这个脚本 dm_params(--windowsadd_cpus 24 32 40 48-m 4096M--ovmf /home/eci-user/work/OVMF.fdadd_virtual_device 1:0 lpcadd_virtual_device 0:0 hostbridgeadd_virtual_device 3 xhci 1-6add_passthrough_device 2 0000:00:02.0add_logger_settings console4 kmsg3 disk5-s 6,virtio-blk,/home/eci-user/work/win10-ltcs.img-s 7,ahci,cd:/home/eci-user/work/Windows.iso-s 8,achi,cd:/home/eci-user/work/winvirtio.iso-s 9,passthru,0/14/0,d3hot_reset-s 10,virtio-net,taptap0WIN10
) 这里稍微解释一下 这个是我的USB键鼠收发器 这个是我的intel的VGA 这个是USB Controller 我之前没加无法重启windows安装器结束后重启一直蓝屏不知道是不是和这个有关加上去了就好了
运行脚本显示器上会出现boot from CD/DVD这时候键盘按下任意按键
boot from CD/DVD这时候键盘按下任意按键
boot from CD/DVD这时候键盘按下任意按键 在这一步选择加载驱动然后点击浏览选择到有一个CD ROM磁盘里面有vio\win10\amd64.把下面的隐藏不兼容驱动去掉全选所有的驱动点击下一步。 就会出现磁盘了我没有截图借用一下官网的这里我们的是40G的 Step4 一些问题
安装完后机器会重启重启的时候就不需要按键盘了直接等待让他进入win10的引导。但是你可能会跟我一样出现下面的问题
1.蓝屏 2.一直是Recovery 没有解决办法。。我试了一下午有一次添加-s 9,passthru,0/14/0,d3hot_reset并重启电脑以后它就正常了。。。
Step5 正常启动
我们可以拷贝之前的lanuch脚本然后把windows.iso和winvirtio.iso删除就可以了。 庆幸的是这个win10-ltsc.img是可以复用的。所以下一次不用这么苦逼的装系统了。