Where to set manual DNS with vpn boot script?

Sounds like you have more serious problems with your setup if you can’t edit that file with sudo.

Can you post the output of sudo ls -al /etc/resolv.conf?

1 Like

Hi @yknivag
the command gives the following output

-rw-r--r-- 1 root root 137 May 15  2016 /etc/resolv.conf

So yeah, I am running everything as user=osmc .
I tried this:

osmc@osmc:~$ sudo chown osmc:osmc /etc/resolv.conf
chown: changing ownership of '/etc/resolv.conf': Operation not permitted


osmc@osmc:~$ sudo chmod 777 /etc/resolv.conf
chmod: changing permissions of '/etc/resolv.conf': Operation not permitted

sudo su puts me in root@osmc

Whats the output from mount

1 Like

Hi @fzinken . thank you or helping!
not sure what I am looking at

osmc@osmc:~$ mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=370520k,nr_inodes=92630,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mmcblk0p2 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
sysfs on /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq type sysfs (rw,relatime)
/dev/sda1 on /media/wdbook type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=75104k,mode=700,uid=1000,gid=1000)

I wanted to just check how your file system is mounted as I was expecting there and issue.
Really getting less ideas. Upload full logs with grab-logs -A maybe we find something

1 Like

Greatly appreciated.
Here we are: http://paste.osmc.io/ronuhugafu

A bit of context. The system has been updated since a fresh install about 9 months ago I think.
As can be seen from the first post, I have tried to apply a script for openvpn to start at boot.
At the moment I believe the script is not running, however openvpn does connect automatically. Although not with the DSN server.
Checking the status of rc.local says that the process has failed.

update: the vpn is not running at the moment using the current settings.

Can you post the outcome of:

echo Test > test
cat test

And also
cat /etc/passwd


osmc@osmc:~$ echo Test > test
osmc@osmc:~$ cat test


smc@osmc:~$ cat /etc/passwd
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
systemd-timesync:x:100:103:systemd Time Synchronization,,,:/run/systemd:/bin/false
systemd-network:x:101:104:systemd Network Management,,,:/run/systemd/netif:/bin/false
systemd-resolve:x:102:105:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:103:106:systemd Bus Proxy,,,:/run/systemd:/bin/false
avahi:x:105:108:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
ftp:x:111:119:ftp daemon,,,:/srv/ftp:/bin/false

Had you set a root password in the past?
If yes can you try su and then change the file?

I do not recall setting a password., but su prompts me to input it though.

Try to reset it with sudo passwd

1 Like

nice, I was able to reset the password, it now reads rialto

Can you now do su and change your files?

can you please guide me threw the steps?

I can log in as root@osmc

root@osmc:~# chmod 777 /etc/resolv.conf
chmod: changing permissions of '/etc/resolv.conf': Operation not permitted

Can you change the content as root?

ie as root, can you issue:

nano /etc/resolv.conf make a change and save it with CtrlO? Or does it say read-only there also?

If it does then there is something very seriously amiss and you may be best off with a clean install.

A permission error remains while logged in as root.
I tried adding a line to nano /etc/resolv.conf
got a permission denied prompt while saving.

I think I’ll be working on a full clean install.
Can anyone direct me to a good tutorial for openvpn that is tailored to OSMC?

Also, I would like to thank @yknivag @fzinken @sam_nazarko @joakim_s @ActionA and @jimblazin for helping me with this issue!

Yes, clean reinstall makes sense (and avoiding none official addons in the future).
For openvpn there are a couple of threads in the forum just search.