I have an Apple M1 processor (ARM64). Is there any way to spin a x86_64 machine? By default Multipass 1.8.0 is launching ARM64 Ubuntu instances.
I build a Docker container from the following Dockerfile:
FROM ubuntu:20.04
RUN apt-get update && apt-get -y install clang gcc-aarch64-linux-gnu
I'm on an x86_64 macOS v10.15.7 host system which means the Docker container will see an x86_64 CPU which I confirm by running this command inside the container:
$ lscpu
Architecture: x86_64
# remaining output omitted for brevity
I then compile and run an aarch64 assembly program using the following commands from inside the container:
$ clang -nostdlib -fno-integrated-as -target aarch64-linux-gnu -s hello_world.s -o hello_world.out
$ file hello_world.out
hello_world.out: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=a4622c2802958a4c37ae82ec21f510e9f823ca4a, stripped
$ ./hello_world.out
Hello world!
My question is: how does this work? How can I run an aarch64 ELF file on x86_64 Ubuntu? QEMU is not installed so what is providing the aarch64-to-x86_64 emulation layer? Is this maybe some feature of Docker or the underlying macOS host system?
On a Raspberry Pi 4, on a vanilla downloaded 19.10 image of Ubuntu 19 arm64, I failed trying to enable cgroup memory, needed for Kubernetes.
I created (because I don't understand well the real one, I think the 4th)
/boot/cmdline.txt
/boot/firmware/cmdline.txt
/boot/firmware/btcmd.txt
(modified)/boot/firmware/usercfg.txt
(modified)
to append:
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
but in vain.
If I check cat /proc/cgroups
the cgroup memory is disabled.
If I check cat /proc/cmdline
there isn't.
How can I fix that?
This is my very first question in this forum. Sorry for my bad english, please advise if it is not the right place to do it.
I've tried to install Swift for Ubuntu 19.04 on Termux App for Android following the answer of another question in this Forum: (How can I install Swift on Ubuntu 19.04?).
The reason is to continue compiling code offline while I'm in a plane or without internet connection. The steps followed are shown below (in short):
1- Since there is no way to install Swift for Ubuntu 19.04 I downloaded this file for version 18.04 as recommended (swift-4.2-DEVELOPMENT-SNAPSHOT-2018-10-30-a-ubuntu18.04.tar.gz).
2- Extracted the file and copied the folder to home directory in order to run locally.
3- Added the path to Swift with the following command which didn't work:
$ export PATH="/home/your-username/swift/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-10-30-a-ubuntu18.04/usr/bin:$PATH"
$ source ~/.bashrc
4-Then I made amendments found in the web in order to write .bashrc:
$ echo "export PATH=/home/myusername/swift/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-10-30-a-ubuntu18.04/usr/bin:$PATH" >> ~/.bashrc
$ source ~/.bashrc
5-The output writed in the end of .bashrc file was this:
export PATH=/home/user-name/swift/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-10-30-a-ubuntu18.04/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
6- Then I tried to run Swift in terminal and I got this error message:
$ swift
bash: swift: command not found
For me it seems that the echo command appended the swift-4.2.../usr/bin path along with the others PATHs already set up in Ubuntu's Termux separate by collon, yet it doesn't allow me to call Swift REPL from Terminal.
Please help, thanks
Edit: my environment
- Xiaomi Redmi Note 4x - processor 64-bit ARMv8-A
Termux App:
$ uname -a Linux localhost 3.18.31-perf-g653a83a #1 SMP PREEMPT Mon Jan 28 10:05:53 WIB 2019 aarch64 Android
About PRoot package for Termux:
Package: proot
Description: Emulate chroot, bind mount and binfmt_misc for non-root users
Homepages: https://proot-me.github.io
https://github.com/proot-me/PRoot
PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc. This means that users don't need any privileges or setup to do things like using an arbitrary directory as the new root filesystem. The benefits of enabling PRoot include running Linux operating systems in a Termux chroot on an Android smartphone and tablet, and Chromebook.
Ubuntu distribution installed (source: https://wiki.termux.com/wiki/Ubuntu):
root@localhost:~# uname -a Linux localhost 3.18.31-perf-g653a83a #1 SMP PREEMPT Mon Jan 28 10:05:53 WIB 2019 aarch64 aarch64 aarch64 GNU/Linux
root@localhost:~# cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=19.04 DISTRIB_CODENAME=disco DISTRIB_DESCRIPTION="Ubuntu 19.04" NAME="Ubuntu" VERSION="19.04 (Disco Dingo)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 19.04" VERSION_ID="19.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=disco UBUNTU_CODENAME=disco
Is there a way to emulate it with Qemu? If yes, can you guide me?
Thanks
My 64Bit ARM platform is shipped with Ubuntu 16 and I need to run my 32 bit App which is compiled for ARM32:
[root@artik publish]# file myApp
myApp: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=b455beda566647d2bfebccd157261c60c60f64b3, stripped
Is it possible to run an ARM32 bit app on an ARM64bit Ubuntu 16.0? What are the needed 32 bit libraries that can support the ARM32 bit app and where should I install them from?
Below article answers this same question for x86 but how can I do it for Arm32 apps on ARM64?
How to run 32-bit app in Ubuntu 64-bit?
Thanks in advance, Emeel