Running Linux Applications on x86
An installed x86 application can run on both the guest and host.
Run the exagear command to start the guest shell and run any x86 application. The running mode is the same as that on the x86 system. For example:
exagear
Command output: Starting /bin/bash in the guest image /opt/exagear/images/centos-<os_version>-x86_64
which nginx
Command output: /usr/sbin/nginx
/usr/sbin/nginx -h
In a host session, perform either of the following operations:
- Enter the exagear -- command and the x86 application path in the guest system in the same line. For example:
exagear -- /usr/sbin/nginx -h
- Enter the full path of the x86 application binary file. This file is stored in a specific directory: /opt/exagear/images/centos-<os_version>-x86_64, that is, the x86 operating environment. For example:
/opt/exagear/images/centos-<os_version>-x86_64/usr/sbin/nginx -h
By default, x86 applications can access only files in the x86 operating environment. To access files in the host system, you can set the directories or files to be shared between the host and guest systems. For details about the configuration method, see Configuring ExaGear for Server on CentOS.
Note:
You are advised to run the script program after entering the guest environment or run the following command on the host.
exagear -- /path/to/script
The test.sh script is used as an example. The script content is as follows:
#!/bin/bash
if [ `arch` == 'x86_64' ]
then
echo "ok"
else
echo "fail"
fi
Result comparison:
./test.sh
Command output: fail
exagear -- ./test.sh
Command output: ok
The installation and running of the Linux x86 32-bit and 64-bit applications on the guest system are the same as those on the q-nary x86 system.