[AOSP] No response after "lunch hikey960-userdebug"

Hello, I’m trying to build the Android source code for my Hikey 960 board.
I’m following this video tutorial 96Boards LeMaker HiKey 960 Building Android AOSP From Source - YouTube in parallel to the official Android guide (source.android.com/setup/devices#hikey-boards)

Everything went fine until I reached the command “lunch hikey960-userdebug”. It blocks, without returning any output. I left it “working” for 1 hour and then I aborted it (even if I know that this command should take few seconds). If I execute only “lunch” it shows the list of available build targets, and when I select “hikey960-userdebug” it blocks. When I abort it with CTRL+C, it says “Still alive, killing subprocesses” and then it shows a lot of messages referring to threads. Here is the screenshot https://ibb.co/k32KQR
I noticed that also the “make” command (inside the AOSP directory) has the same behaviour.

This is the list of commands I’ve used during the process:

sudo apt-get install openjdk-7-jdk
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
mkdir output
export OUT_DIR_COMMON_BASE=/home/brucedh/output/
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir dev
cd dev
mkdir hikey960
cd hikey960
git config --global user.name "<REDACTED>"
git config --global user.email "<REDACTED>"
repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync –j4
git clone https://android.googlesource.com/kernel/hikey-linaro
cd hikey-linaro
git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9
make ARCH=arm64 menuconfig
make ARCH=arm64 hikey960_defconfig
PATH=/home/brucedh/dev/hikey960/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/:$PATH
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j4
cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ../device/linaro/hikey-kernel/hi3660-hikey960.dtb-4.9
cp arch/arm64/boot/Image.gz ../device/linaro/hikey-kernel/Image.gz-hikey960-4.9
cd ~/dev/hikey960
. ./build/envsetup.sh
lunch hikey960-userdebug

I’m using Ubuntu 16.04 LTS as guest on Virtualbox. I tried to do all the process once again from the beginning with a new virtualbox image, but I found the same problem.

Thanks in advance!

Virtualbox is dead slow on its very best days.
Have you checked the CPU load while this is happening?

First thing I’d try is not virtualizing your linux. Install it properly.

And I cannot confirm the ubuntu-specific parts of it (I hate that distro – prefer RHEL or Fedora).

Yes, I will probably follow your advice and retry with Ubuntu in dual boot.

In any case, this is the the output of strace attached to the process in which i executed lunch.

While lunch is stuck, the output shows only “wait4(-1,”, the remaining part appears only when I abort lunch with CTRL+C.

The lunch command takes a really long time. This is from my computer today:

$ time lunch hikey960-userdebug

============================================
PLATFORM_VERSION_CODENAME=P
PLATFORM_VERSION=P
TARGET_PRODUCT=hikey960
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a73
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a73
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.10.0-42-generic-x86_64-Ubuntu-16.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OC-MR1
OUT_DIR=out

real 0m59.389s
user 0m1.320s
sys 0m0.772s

But I have a build error after a while (which I don’t understand yet).