Solved:How to set my media?

I have installed homeassistant this way:

 sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt-get install -y python3 python3-dev python3-venv python3-pip   \
         bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf       \
         build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata    \
         ffmpeg liblapack3 liblapack-dev libatlas-base-dev

    sudo useradd -rm homeassistant
    sudo mkdir /srv/homeassistant
    sudo chown homeassistant:homeassistant /srv/homeassistant
    sudo -u homeassistant -H -s
    cd /srv/homeassistant
    python3.11 -m venv .
    source bin/activate
    python3 -m pip install wheel
    pip3.11 install homeassistant==2023.7.3
    pip3.11 install git+https://github.com/boto/botocore

Vlc installed already:

sudo dpkg -l vlc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version          Architecture Description
+++-==============-================-============-==============================>
ii  vlc            3.0.18-0+deb11u1 amd64        multimedia player and streamer
lines 1-6/6 (END)...skipping...
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version          Architecture Description
+++-==============-================-============-=================================
ii  vlc            3.0.18-0+deb11u1 amd64        multimedia player and streamer

Set media configuration:

vim  $HOME/.homeassistant/configuration.yaml

media_player:
  - platform: vlc

homeassistant:
  media_dirs:
    media: /home/debian/.homeassistant/media

Restart hass,open “127.0.0.1:8123” with browser:

## No local media found

It looks like you have not yet created a media directory.
Check the [documentation](https://www.home-assistant.io/more-info/local-media/setup-media) on how to setup local media.
Place your video, audio and image files in the media directory to be able to browse and play them in the browser or on supported media players.

Show some music:

ls  /home/debian/.homeassistant/media
test.mp3

How to fix it?

Try

homeassistant:
  media_dirs:
    local: /home/debian/.homeassistant/media

It seems that $HOME/.homeassistant/configuration.yaml can not control my homeassistant.
I set position in ShangHai far from my home ,one thousands miles away.

cat  /home/debian/.homeassistant/configuration.yaml
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes
# Text to speech
tts:
  - platform: google_translate

media_player:
  - platform: vlc

homeassistant:
  media_dirs:
    local: /home/debian/.homeassistant/media    

latitude: 22.57
longtitude: 113.94915

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Restart hass and 127.0.0.1:8123,the position in map have not been changed!

Solved.
I have make hass as a service.


cat  /etc/systemd/system/home-assistant.service
[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=homeassistant
WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
RestartForceExitStatus=100

[Install]
WantedBy=multi-user.target

The configuration file located in “/home/homeassistant/.homeassistant” instead of " /home/debian/.homeassistant",edit in “/home/homeassistant/.homeassistant/configuration.yaml” .