鲲鹏社区首页
中文
注册
练习1:新建aarch64环境与x86_64环境之间的共享目录

练习1:新建aarch64环境与x86_64环境之间的共享目录

DevKit

发表于 2023/11/15

0

在aarch64环境下,为了在Host和Guest系统之间共享文件,创建两个相关目录并修改一个配置文件:

mkdir /test/
mkdir /opt/exagear/images/centos-7-x86_64/test/
echo “/test/” >> /opt/exagear/images/centos-7-x86_64/.exagear/vpaths-list

如此,新的/test/就作为aarch64环境与x86_64环境之间新的共享目录存在了。

作为验证,我们仍然用helloworld这个例子。先进入到x86_64虚拟环境:

exagear
arch

在x86_64环境,将前面提到的helloworld程序复制到/test/:

cp helloworld /test/

然后,我们在aarch64环境下访问/test/共享目录,用两种不同的方式运行helloworld。两者均是在aarch64环境中运行x86_64格式的helloworld程序。

(1)隐式启动ExaGear工具:

/test/helloworld

(2)显式启动ExaGear。

exagear -- /test/helloworld

需要说明的是,在aarch64环境下,若helloworld不是被放置在Guest与Host共享的目录中,那么ExaGear不会起作用,程序无法正确执行。

例如,我们在aarch64环境创建一个未共享的/test2。Helloworld程序在此目录下无法执行: