How to headless your VisionFive 2 with wifi without monitor/keyboard

Hi

So here i want to share my step by step guide to get headless VisionFive2 going without connecting it to a monitor when you only have wifi available.

As far as i know this is not needed if you can plug it into a ethernet cable. Then it should just show up in your network.

However if you like me have only wifi available this is a bit tricky so here is my short guide.

Basically this is like a Raspberry Pi headless guide but for the VisionFive2.

So lets jump right in.

Prerequisites

  1. You need your board patched to 3.04 firmware to be able to use the latest image. So patch spi and uboot to 3.04 Firmware.

  2. I use the 202306 minimal desktop image. This comes with Gnome/Networkmananger.

  3. Wifi usb module plugged into the board. I use the ESWIN 6600U and it works great.

Flash the image

First flash the image to your SD card. I use balea etcher for this.
After flashing open /mount the image.

in my PC this is mounted into:

 /run/media/user/root/

Configure Image

So now you can make some files as root. Otherwise you will not be able to make the files:

auto.sh

#!/bin/bash

#/opt

# Wait till boot has finshed/ is further along
sleep 50

# put correct nameserver into resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
sleep 5
echo "nameserver 1.1.1.1" >> /etc/resolv.conf

sleep 5
# Connect to Wifi

nmcli radio wifi on
nmcli dev wifi connect "Wifi-Network-Name" password "wifi-password-here"

Here switch out Network name and password obviously.

autostart.service

[Unit]
Description=How-To Geek Service Example

Wants=network.target
After=syslog.target

[Service]
Type=simple
ExecStart=/opt/auto.sh
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

#/etc/systemd/system/htg.service

Now copy these into the SDcard image:

cp auto.sh /run/media/user/root/opt/
chmod +x /run/media/user/root/opt/auto.sh
cp autostart.service /run/media/user/root/etc/systemd/system/
chmod 640 /run/media/user/root/etc/systemd/system/autostart.service
cd /run/media/user/root/etc/systemd/system/multi-user.target.wants/
ln -s ../autostart.service

Now we have setup an sytemd autostart unit that will start auto.sh after some time in booting.

This should do the trick but i also want to login for the first time when i boot the board to the initial home dir gets populated.

To manage this edit this file:

/run/media/user/root/etc/gdm3/daemon.conf

And just uncomment and change these lines:

TimedLoginEnable = true
TimedLogin = user
TimedLoginDelay = 5

So now save everything and make sure to do a clean unmount.

Put your card into the VisionFife2 and boot it up. It should connect to your wifi and then you can ssh into it.

Have fun!

1 Like

Do not set DNS Server manually. This will affect CDN.

Thanks! Interesting to know. However it did not work correctly if i did not set it. It had my normal router in there but could not resolve…

/etc/resolv.conf is generated by networkmanager.
If resolv.conf is empty or not created when you connected wifi, check your configure of network manager software.

PS: Sometimes /etc/resolv.conf is a soft-link. The target is placed in /run or otherwhere.

1 Like

Hats off to the excellent distribution DietPi. Headless is in its fundamental DNA because SBCs are their primary target.

How to install DietPi - DietPi.com Docs has two little blue pop-out that shows the steps for going headless. Be sure to expand
Click here if you want to use a WiFi connection
and
Click here if you want to connect via SSH (running a headless install)

at

when you’re installing. I’ve used DietPi this way for years. (Not all on RISC-V.) Works great.

Anyone new to this market would be wise to invest (they’re cheap) in a USB-Serial adapter just in case something goes wrong. My rule is to start with the easy way as described in the doc and then dig out an adapter only if I have to.

1 Like