FEX-Emu在Debian/Ubuntu系统使用

FEX-Emu在Debian/Ubuntu系统使用

  • [1. Debootstrap子系统安装(可选)](#1. Debootstrap子系统安装(可选))
  • [2. Debian/Ubuntu依赖包安装](#2. Debian/Ubuntu依赖包安装)
  • [3. 获取FEX-Emu源码并编译](#3. 获取FEX-Emu源码并编译)
  • [4. 根文件系统RootFS安装](#4. 根文件系统RootFS安装)
  • [5. 基于 FEX-Emu 运行应用](#5. 基于 FEX-Emu 运行应用)

1. Debootstrap子系统安装(可选)

c 复制代码
sudo apt-get install debootstrap
sudo debootstrap --arch arm64 bullseye ~/arch/debian https://mirrors.tuna.tsinghua.edu.cn/debian/
sudo debootstrap --variant=buildd --arch arm64 bullseye ~/arch/debian https://mirrors.tuna.tsinghua.edu.cn/debian/

安装成功后,进入目录切换环境

c 复制代码
cd ~/arche/debian
sudo chroot .

2. Debian/Ubuntu依赖包安装

按照官网要求安装全部依赖库:

c 复制代码
apt install git cmake ninja-build pkgconf ccache clang llvm lld binfmt-support libsdl2-dev libepoxy-dev libssl-dev python-setuptools g++-x86-64-linux-gnu libgcc-10-dev-i386-cross g++-x86-64-linux-gnu libgcc-10-dev-amd64-cross nasm python3-clang libstdc++-10-dev-i386-cross libstdc++-10-dev-amd64-cross libstdc++-10-dev-arm64-cross squashfs-tools squashfuse libc-bin  libc6-dev-i386-amd64-cross lib32stdc++-10-dev-amd64-cross 

如果提示找不到包可以配置一下源 /etc/apt/sources.list: (安装成功请略过此步骤)

c 复制代码
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://security.debian.org/debian-security bullseye-security main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye main

更新源后再次安装:(安装成功请略过此步骤)

c 复制代码
apt update

3. 获取FEX-Emu源码并编译

在子系统获取代码和子模块:

c 复制代码
git clone --recurse-submodules https://github.com/FEX-Emu/FEX.git

编译源码:

js 复制代码
cd FEX
 mkdir Build
 cd Build
 CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja ..

configure完成后,执行ninja

c 复制代码
ninja

我这里会报如下错,可能我安装的libstdc++的版本问题 (没有出错可以略过):

js 复制代码
../Source/Tools/pidof/pidof.cpp:56:24: error: no matching constructor for initialization of 'std::istringstream' (aka 'basic_istringstream<char>')

暂时强制改一下代码:

c 复制代码
std::istringstream ss{static_cast<std::string>(Omit)};

重新执行,没有错了

js 复制代码
CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja ..

执行安装命令:

js 复制代码
root@nfs-PC:/FEX/Build# ninja install
[0/2] Re-checking globbed directories...
[0/1] Install the project...
-- Install configuration: "RELEASE"
-- Installing: /usr/share/man/man1/FEX.1.gz
-- Installing: /usr/lib/libFEXCore.a
..........................................
-- Installing: /usr/bin/FEXServer
-- Installing: /usr/bin/FEXBash
-- Installing: /usr/bin/FEXLoader
-- Installing: /usr/bin/FEXInterpreter
-- Installing: /usr/bin/FEXUpdateAOTIRCache
-- Installing: /usr/bin/FEXpidof
-- Installing: /usr/share/fex-emu/AppConfig/client.json
-- Installing: /usr/share/fex-emu/ThunksDB.json

4. 根文件系统RootFS安装

当前的debian系统,默认没有curl,fex工具会用到,因此需要先安装一下:

上述编译并安装完成后可以执行FEXRootFSFetcher来安装RootFS,终端会提示你rootfs没有找到,是否下载, 输入y:

当前验证的机器用的是debian11版本,没有对应的版本,我们就用Ubuntu 20.04

下载完成后、解压配置为默认RootFS:

5. 基于 FEX-Emu 运行应用

直接运行安装目录下的FEXBash命令来启动:

接下来启动一下wine看一下效果,这里我用的是自己编译的wine9.4, 关于如何编译wine可以参照 Wine编译环境搭建及使用完整流程详细笔记, 会发现有如下错误:

回到宿主机执行一下: xhost + 让其允许子系统使用其显示窗口

c 复制代码
xhost + 
access control disabled, clients can connect from any host

回到FEXBash-root中再次启动

c 复制代码
FEXBash-root@nfs-PC:/home> ./install/opt/winux/wine9.4/usr/local/bin/winecfg     

可以看到如下效果:

复制代码
/home/install/opt/winux/wine9.4/usr/local/bin/wine notepad
相关推荐
大牧师7 小时前
TypeORM 学习教程
数据库·sql·学习·node.js·orm·nest.js·typeorm
IvorySQL7 小时前
PostgreSQL 日报| PGQ 功能发现严重缺陷(9 月 4 日)
数据库·postgresql
后台模板学习7 小时前
用 IM 即时聊天项目一次讲清消息去重算法的踩坑与解决方案
java·数据库·spring
imbackneverdie7 小时前
国内有哪些比较全面的生物医学相关数据库?
大数据·数据库·人工智能·ai·信息可视化·aigc·科研
数字智核8 小时前
2026昆山工厂空压机突然停机怎么办?找谁抢修
服务器·网络·数据库
迷路爸爸1808 小时前
在 Ubuntu / Linux 上轻量安装 LaTeX:TinyTeX 使用记录
linux·运维·ubuntu
与自己和解7418 小时前
使用ssh实现 VScode 直连 ubuntu
vscode·ubuntu·ssh
AAA代码批发商8 小时前
Days 39 Linux C 开发之 SQLite 数据库完整学习笔记
linux·c语言·数据库
笑梦无境8 小时前
mysql的安装及配置(3)
数据库·mysql·adb
电商API_180079052478 小时前
跨境1688代采商家,如何借助API打通供应链,实现效率跃迁
大数据·数据库·网络爬虫