Installing Alt-Linux to eMMC - any khadas board VIM1 VIM2 VIM3 VIM3L Edge

HOW-TO install AltLinux for any Khadas SBC

Start krescue from SD

Preparation notes

  • your SBC must connected to internet via ethernet or Wi-Fi
  • ethernet will auto-connect if a LAN cable is plugged in before boot-up

Wi-Fi configuration

If you’re currently in a console / shell, just type krescue or exit to return to Krescue’s main menu

  • krescue main menu -> network -> wifi -> connect /select

Manual install Alt-Linux into eMMC from shell

  • krescue main menu -> shell
# create partitions
echo "label: dos" | sfdisk $(mmc_disk)
echo "part1 : start=16M," | sfdisk $(mmc_disk)

# create rootfs
mkfs.ext4 -L ROOT $(mmc_disk)p1
mkdir -p system && mount $(mmc_disk)p1 system

# download and extract u can chouse any other source from Images variants

curl -jkL $SRC | pixz -dc | tar -xf- -C system

# fix dtb paths
for a in system/lib/devicetree/*-alt1; do ln -s . $a/amlogic; ln -s . $a/rockchip; done

# maybe need fix extlinux config
cp system/boot/extlinux/extlinux.conf system/boot/extlinux/extlinux.conf.bak
# sed -i s/console=tty1/earlyprintk/ system/boot/extlinux/extlinux.conf

echo ttyAML0 >> system/etc/securetty
echo ttyFIQ0 >> system/etc/securetty

# install uboot to eMMC
mmc_update_uboot online
# optional to SPI
spi_update_uboot online -k && poweroff # poweron



User/root access

user: root
password: altlinux


  • not tested
  • serial console not active
  • kernel missed some drivers

Image variants

ENJOY :wink:


PS: next time i will write similar instructions for ArchLinux and any other distros


Very cool, thank you very much.

I tried to follow the instructions twice - I didn’t succeed.
Maybe I need to edit /boot/extlinux/extlinux.conf
But I do not know what to edit there.
After a reboot, u-boot cannot start Alt-linux on eMMC.

For work, it is better to use stable Alt-linux builds.
Here are some examples:

I have achieved a working version like this:
I left boot and the kernel from Khadas Ubuntu, and replaced rootfs with Alt-Linux (alt-p9-mate-20210612-aarch64.tar. xz)

That’s how it was

I tried to follow the instructions twice - I didn’t succeed.
Maybe I need to edit /boot/extlinux/extlinux.conf
But I do not know what to edit there.
After a reboot, u-boot cannot start Alt-linux on eMMC.

plz check all steps again (i have test it 2 times - works fine )
just copy-paste

maybe easy via ssh

ssh root@krescue.local or http://krescue.local:8088

PS: try other one-line script inside Krescue shell > krescue/ at master · khadas/krescue · GitHub

curl -jkL | sh -s -
1 Like

I’m dreaming about ssh.
You’re probably using a serial console, I don’t have that luxury. Only ssh over the network.
Or I need to tweak the ssh settings.
Currently ssh only works on localhost.

I was able to input it manually without copy paste
It’s works.

You are a wizard, a wonderful work.

I downloaded your script, supplemented it with options for building different Alt-Linux images, made sure that it works perfectly and will use it in my work.
Thank you very much. You’ve been very helpful.

The latest krescue update fixed this issue. now I can use ssh over the network.
Thank you very much.
The longer I talk to you, the more I like you.
Well done.

ssh root@

BusyBox v1.30.1 () built-in shell (ash)


 __ _____  Khadas ## hyphop ## 
/ //_/ _ \___ ___ ______ _____ 

/ ,< / , / -|-</ __/ // / -)

extreme tiny and fast rescue system

BUILD: 210722_184 from: Thu Jul 22 04:37:19 2021

[i] POST_CONFIG: booted=spi + hwver=VIM3.V12 + || start: /dev/mmcblk0
[i] Device: VIM3 Amlogic:G12B ver:0x0003 6 cores 4G ram 29.1 G eMMC
[w] root password undefined
[i] just type > krescue < to start gui

1 Like

plz check this one 1st

1 Like

The happiness was short-lived.
A new version has been released and the task has become more complicated.
Instead of tar, img is now - not simple, it with two partitions and it is not clear how to install it.

root@Krescue:~# fdisk -l /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img
Disk /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img: 7.27 GiB, 7800356864 bytes, 15235072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2939b6ed

Device                                                   Boot  Start      End  Sectors  Size Id Type
/tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img1       32768   526335   493568  241M  c W95 FAT32 (LBA)
/tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img2 *    526336 15233023 14706688    7G 83 Linux
root@Krescue:~# udisksctl
-ash: udisksctl: not found
root@Krescue:~# mount -o loop,offset=$((526336*512)) /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img /mnt
mount: mounting /dev/loop0 on /mnt failed: Invalid argument
root@Krescue:~# dmesg
[16129.601357] loop0: detected capacity change from 0 to 15235072
[16129.616417] squashfs: Unknown parameter 'offset'
[16129.618113] exfat: Unknown parameter 'offset'

tnx for notify
i will check new alt images later ( try on this week )

Are new images fixed for installation using Krescue? Thanks

Hi Bro,

I have also tried the manual steps to install alt-linux to my vim3 via Krescue Shell… everything went well but the device does not boot. Kernel starts to load but it again goes to khadas logo. I have mainline uboot on spi as well as emmc…

Can you please help how i can manually install alt-linux? currently the online scripts of Krescue by hyphop are also not working due to a tar.xz/img.xz mix-up…

ANy help would be appreciated. Thanks

khadas vim 3 is not easy, I spent half a year of my life on it, but I never succeeded in it.
Here on the profile forum my attempts are described:
Not the worst option where I managed to achieve normal results is to install the root system from alt linux and the kernel and drivers from the newest armbian linux.
The Guru believes that when paying for his services, he could bring khadas a good result, but I ran out of patience, the system is extremely unstable and often hangs at the most inopportune time.
I put this device in the back drawer and switched to working with other devices, the same raspberry, though dumber, but it works stably. I will get a new board rk3566 soon, I hope it will be no worse than raspberries. I am khadas on pause.

the last time it froze, when I compiled my program in Qt C++ in one window, and launched the postqresql console in another window - and that’s it, khadas hung. Although before that, it worked for three days under a synthetic tasks of 90% of the cpu/gpu.
That’s it, the end.
I gave up, khadas won

ALT LINUX not best choose at this moment for VIM3

why not try armbian, ubuntu, fedora - i think its more stable

Артем, вы всё это время мне очень помогали и я приобрел хороший опыт по настройке ARM устройств.
Я благодарен вам за это, возможно мне просто не повезло с конкретной платой, она виснет на любой системе, даже на вашей Ubuntu.
Если сравнивать, то вторая железка, которую я купил и сейчас на ней работаю - это малина с 8 Гб памяти, она работает на Alt Linux 24/7 уже несколько месяцев, да она существенно слабее, чем khadas vim3, зато без сюрпризов.
Не судите меня строго, мне нужна стабильность.