Ubuntu on the milk-v duo

Hello everybody, this is my first post here and i’ll leave a link to my github where i explain how i got ubuntu working on the milk-v duo with a guide:

it’s subject to changes since i just got this working, but please leave feedback

9 Likes

I can’t imagine only 19MB ram is required to run Ubuntu. Great work!

We will introduce a 256MB ram version Duo version with will allow more heavier applications to run.

6 Likes

oh my, that’s great! any timeline of when it will be out?

1 Like

I think it will be available in two weeks.

4 Likes

Thanks a lot for the guide!

I made again a disk image with more additions (see Persistent RNDIS MAC addresses - Solution · Issue #27 · milkv-duo/duo-buildroot-sdk · GitHub) so one can login via virtual Ethernet over USB again: https://xyzdims.com/3d-printers/misc-hardware-notes/iot-milk-v-duo-risc-v-esbc-running-linux/#Ubuntu_Disk_Image

Also documented most of the changes I made to your guide, in case you like to adapt some of them.

How well does apt work for you? When I install new packages, it takes 4+ mins due the “Building dependency tree…” using up all RAM + swap.

Also, zram seems to require linux-headers/modules in order to work.

3 Likes

hi, zram worked for me, i enabled it in the buildroot kernel config as shown on the guide then all i had to do was install zram-config, enable it with sudo systemctl enable zram-config and reboot.

1 Like

Ah, redid build_milkv.sh with rm -rf build/output first again, now it worked.

systemctl status zram-config excerpt:

Sep 19 16:57:12 milkv-duo init-zram-swapping[255]: Setting up swapspace version 1, size = **27.5 MiB (28811264 bytes)**

apt is still very slow, same for you @treble?

2 Likes

that’s great! yeah APT is also slow on my end when it’s building the dependency tree

1 Like

Hi @treble, please could you provide a link to the guide you used to enable zram (in the Linux kernel) or elaborate further?

1 Like

hi, there’s a few comments in the guide i wrote that show you how to do that :

3 Likes

any news in regards to this?

1 Like

@treble just wanted to drop a note and say thanks for that awesome write up.
I was able to follow your instructions and got Ubuntu working!

I don’t understand why at the end you created a tar file, that whole step seems unecessary.
You can mount the system image directly, wipe it, and build ubuntu inside of that.

My image is named milkv-duo-20231207-0834.img here are the commands:

fdisk -l milkv-duo-20231207-0834.img

Disk milkv-duo-20231207-0834.img: 2.13 GiB, 2281701888 bytes, 4456449 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: 0x00000000

Device                       Boot   Start     End Sectors  Size Id Type
milkv-duo-20231207-0834.img1 *          1  262144  262144  128M  c W95 FAT32 (LBA)
milkv-duo-20231207-0834.img2       262145 4456448 4194304    2G 83 Linux
milkv-duo-20231207-0834.img3      4456449 4980736  524288  256M  0 Empty

Then calculate the offset, in my example that’s the start 262145*512 (multipled by the sector size)

offset=$(expr 262145 \* 512)
devloop=$(sudo losetup -o $offset -f --show milkv-duo-20231207-0834.img)
# ex: /dev/loop4
sudo mkdir /mnt/milkv_duo
sudo mount $devloop /mnt/milkv_duo

:man_mage:t2: the filesystem of the image is now mounted on /mnt/milkv_duo

2 Likes

Duo 256M is available to pre order now at:

5 Likes

ahhh that’s sick, thanks for the help i’ll probably update the guide and credit you

1 Like

Two weeks? I’m assuming it’s already out at this point. Is there a place you can purchase one?
update: nevermind, saw the link haha

1 Like

I setup my SD card with the rootfs image provided in the GitHub repository, indicating having a link to my router (OpenWRT), but I’m not getting an IP address from DHCP. Did I do something wrong?

1 Like

Are you using the Duo IO board? Which image did you write to the SD card?

1 Like

hi, what’s the output of ip a ? did you try running dhclient -v eth0

1 Like

Yeah, I thought I mentioned it but apparently forgot about it. As for image I followed the instructions to build my own and copied the rootfs from the github repo to the SD after wiping the old rootfs

Also, any news on when the 256mb model will ship?

Awesome work!
@Spiritdude - Any update on the slow apt installation?

Many thanks.