Restored AppVM & Template - no networking

No. Both the template and the AppVM return this:

user@test-ham:~$ ls -l /sbin/nft
ls: cannot access '/sbin/nft': No such file or directory

Can you confirm that you have it here:

ls -l /usr/sbin/nft

Yes. It’s there.

user@test-ham:~$ ls -l /usr/sbin/nft
-rwxr-xr-x 1 root root 26696 Sep  4  2022 /usr/sbin/nft

Then let’s try something. In the AppVM, copy nft from that location to the missing one and restart the qubes-network-uplink service:

sudo cp /usr/sbin/nft /sbin/nft
sudo systemctl restart qubes-network-uplink.service
1 Like

Oh! That did something!

user@test-ham:~$ sudo cp /usr/sbin/nft /sbin/nft
user@test-ham:~$ sudo systemctl restart qubes-network-uplink.service
user@test-ham:~$ ping yahoo.com
PING yahoo.com (74.6.143.26) 56(84) bytes of data.
64 bytes from media-router-fp74.prod.media.vip.bf1.yahoo.com (74.6.143.26): icmp_seq=1 ttl=48 time=179 ms
64 bytes from media-router-fp74.prod.media.vip.bf1.yahoo.com (74.6.143.26): icmp_seq=2 ttl=48 time=179 ms
64 bytes from media-router-fp74.prod.media.vip.bf1.yahoo.com (74.6.143.26): icmp_seq=3 ttl=48 time=179 ms
64 bytes from media-router-fp74.prod.media.vip.bf1.yahoo.com (74.6.143.26): icmp_seq=4 ttl=49 time=247 ms
^C
--- yahoo.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 6433ms
rtt min/avg/max/mdev = 178.631/195.996/247.275/29.606 ms

I’ll do that on the template

Good, remember to restart the AppVM after you shut down the template for the change to take effect.

I can confirm that applying that to the Template fixes the network connectivity in the associated AppVMs. Thank you very much @DVM !!

1 Like

Glad it works now!

/sbin should be a link to /usr/sbin.
I’m not sure how this link should be created, either manually created or it should be configured by some service.
What’s the content of /sbin directory?

ls -la /sbin

If it’s empty and only contains nft that you’ve copied then you can remove the directory and create a link manually:

sudo rm -rf /sbin
sudo ln -s usr/sbin /sbin

But clone your template before trying it just in case it’ll break something.

It’s full of other stuff:

$ ls -la /sbin
total 22748
drwxr-xr-x  2 root root     12288 Jan 11 10:00 .
drwxr-xr-x 28 root root      4096 Jan 12  2022 ..
-rwxr-xr-x  1 root root     64936 Jan 21  2022 agetty
-rwxr-xr-x  1 root root   1444104 Apr  3  2021 apparmor_parser
-rwxr-xr-x  1 root root     34984 Jun  7  2021 badblocks
-rwxr-xr-x  1 root root     16351 Feb 23  2021 blkdeactivate
-rwxr-xr-x  1 root root     35048 Jan 21  2022 blkdiscard
-rwxr-xr-x  1 root root    121096 Jan 21  2022 blkid
-rwxr-xr-x  1 root root     76008 Jan 21  2022 blkzone
-rwxr-xr-x  1 root root     67816 Jan 21  2022 blockdev
-rwxr-xr-x  1 root root    131512 Feb  6  2021 bridge
-rwxr-xr-x  1 root root     30872 Oct 15  2020 capsh
-rwxr-xr-x  1 root root    105048 Jan 21  2022 cfdisk
-rwxr-xr-x  1 root root    215376 Feb  9  2021 cgdisk
-rwxr-xr-x  1 root root     47336 Jan 21  2022 chcpu
-rwxr-xr-x  1 root root      1544 Feb  1  2022 cryptdisks_start
-rwxr-xr-x  1 root root       844 Feb  1  2022 cryptdisks_stop
-rwxr-xr-x  1 root root    142920 Feb  1  2022 cryptsetup
-rwxr-xr-x  1 root root    103600 Feb  1  2022 cryptsetup-reencrypt
-rwxr-xr-x  1 root root     39144 Jan 21  2022 ctrlaltdel
-rwxr-xr-x  1 root root    239264 Jun  7  2021 debugfs
lrwxrwxrwx  1 root root         9 Jan  8  2021 depmod -> /bin/kmod
-rwxr-xr-x  1 root root    170464 Feb  6  2021 devlink
-rwxr-xr-x  1 root root    516816 Feb 20  2023 dhclient
-rwxr-xr-x  1 root root     14464 Feb 20  2023 dhclient-script
-rwxr-xr-x  1 root root     47344 Feb 23  2021 dmeventd
-rwxr-xr-x  1 root root    170872 Feb 23  2021 dmsetup
lrwxrwxrwx  1 root root         7 Feb 23  2021 dmstats -> dmsetup
lrwxrwxrwx  1 root root         8 Feb  8  2021 dosfsck -> fsck.fat
lrwxrwxrwx  1 root root         8 Feb  8  2021 dosfslabel -> fatlabel
-rwxr-xr-x  1 root root     30960 Jun  7  2021 dumpe2fs
-rwxr-xr-x  1 root root     51352 Jul  5  2020 dumpexfat
-rwxr-xr-x  1 root root    347808 Jun  7  2021 e2fsck
-rwxr-xr-x  1 root root     39152 Jun  7  2021 e2image
lrwxrwxrwx  1 root root         7 Jun  7  2021 e2label -> tune2fs
lrwxrwxrwx  1 root root         8 Jun  7  2021 e2mmpstatus -> dumpe2fs
-rwxr-xr-x  1 root root      7296 Jun  7  2021 e2scrub
-rwxr-xr-x  1 root root      5395 Jun  7  2021 e2scrub_all
-rwxr-xr-x  1 root root     22760 Jun  7  2021 e2undo
-rwxr-xr-x  1 root root     51352 Jul  5  2020 exfatfsck
-rwxr-xr-x  1 root root     47256 Jul  5  2020 exfatlabel
-rwxr-xr-x  1 root root     51432 Feb  8  2021 fatlabel
-rwxr-xr-x  1 root root    153880 Jan 21  2022 fdisk
-rwxr-xr-x  1 root root     14568 Jan 21  2022 findfs
-rwxr-xr-x  1 root root     76104 Feb  9  2021 fixparts
-rwxr-xr-x  1 root root     24519 Feb 23  2021 fsadm
-rwxr-xr-x  1 root root     55576 Jan 21  2022 fsck
-rwxr-xr-x  1 root root     43272 Jan 21  2022 fsck.cramfs
lrwxrwxrwx  1 root root         9 Jul  5  2020 fsck.exfat -> exfatfsck
lrwxrwxrwx  1 root root         6 Jun  7  2021 fsck.ext2 -> e2fsck
lrwxrwxrwx  1 root root         6 Jun  7  2021 fsck.ext3 -> e2fsck
lrwxrwxrwx  1 root root         6 Jun  7  2021 fsck.ext4 -> e2fsck
-rwxr-xr-x  1 root root     84208 Feb  8  2021 fsck.fat
-rwxr-xr-x  1 root root    125184 Jan 21  2022 fsck.minix
lrwxrwxrwx  1 root root         8 Feb  8  2021 fsck.msdos -> fsck.fat
-rwxr-xr-x  1 root root       333 Dec 17  2021 fsck.nfs
lrwxrwxrwx  1 root root         8 Feb  8  2021 fsck.vfat -> fsck.fat
-rwxr-xr-x  1 root root     14568 Jan 21  2022 fsfreeze
-rwxr-xr-x  1 root root     14496 Dec 17  2021 fstab-decode
-rwxr-xr-x  1 root root     71912 Jan 21  2022 fstrim
-rwxr-xr-x  1 root root    215376 Feb  9  2021 gdisk
-rwxr-xr-x  1 root root     14488 Oct 15  2020 getcap
-rwxr-xr-x  1 root root     14488 Oct 15  2020 getpcaps
lrwxrwxrwx  1 root root         6 Jan 21  2022 getty -> agetty
lrwxrwxrwx  1 root root        14 Jun 18  2023 halt -> /bin/systemctl
-rwxr-xr-x  1 root root    143544 Dec 16  2020 hdparm
-rwxr-xr-x  1 root root    104808 Jan 21  2022 hwclock
-rwxr-xr-x  1 root root     83928 Oct  2  2020 ifconfig
lrwxrwxrwx  1 root root         4 Nov  4  2020 ifdown -> ifup
lrwxrwxrwx  1 root root         4 Nov  4  2020 ifquery -> ifup
-rwxr-xr-x  1 root root     88144 Nov  4  2020 ifup
lrwxrwxrwx  1 root root        20 Jun 18  2023 init -> /lib/systemd/systemd
lrwxrwxrwx  1 root root         9 Jan  8  2021 insmod -> /bin/kmod
-rwxr-xr-x  1 root root     64232 Feb 22  2021 insserv
-rwxr-xr-x  1 root root      2659 Sep 28  2020 installkernel
-rwxr-xr-x  1 root root     57616 Feb  1  2022 integritysetup
lrwxrwxrwx  1 root root         7 Feb  6  2021 ip -> /bin/ip
lrwxrwxrwx  1 root root        19 Oct 27  2019 ip6tables -> /usr/sbin/ip6tables
lrwxrwxrwx  1 root root        27 Oct 27  2019 ip6tables-restore -> /usr/sbin/ip6tables-restore
lrwxrwxrwx  1 root root        24 Oct 27  2019 ip6tables-save -> /usr/sbin/ip6tables-save
-rwxr-xr-x  1 root root     18944 Oct  2  2020 ipmaddr
-rwxr-xr-x  1 root root   5698280 Jul 18  2021 ipp-usb
lrwxrwxrwx  1 root root        18 Oct 27  2019 iptables -> /usr/sbin/iptables
lrwxrwxrwx  1 root root        26 Oct 27  2019 iptables-restore -> /usr/sbin/iptables-restore
lrwxrwxrwx  1 root root        23 Oct 27  2019 iptables-save -> /usr/sbin/iptables-save
-rwxr-xr-x  1 root root     27128 Oct  2  2020 iptunnel
-rwxr-xr-x  1 root root     30952 Jan 21  2022 isosize
-rwxr-xr-x  1 root root    281512 Nov  1  2020 iw
-rwxr-xr-x  1 root root     35328 Mar 14  2020 iwconfig
-rwxr-xr-x  1 root root     23032 Mar 14  2020 iwevent
-rwxr-xr-x  1 root root     14656 Mar 14  2020 iwgetid
-rwxr-xr-x  1 root root     39560 Mar 14  2020 iwlist
-rwxr-xr-x  1 root root     18816 Mar 14  2020 iwpriv
-rwxr-xr-x  1 root root     14624 Mar 14  2020 iwspy
-rwxr-xr-x  1 root root     18760 Oct 11  2020 kbdrate
-rwxr-xr-x  1 root root     26856 Dec 17  2021 killall5
-rwxr-xr-x  1 root root    991016 Oct  3 05:22 ldconfig
-rwxr-xr-x  1 root root     14336 Jun  7  2021 logsave
-rwxr-xr-x  1 root root    112984 Jan 21  2022 losetup
lrwxrwxrwx  1 root root         9 Jan  8  2021 lsmod -> /bin/kmod
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvchange -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvconvert -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvcreate -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvdisplay -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvextend -> lvm
-rwxr-xr-x  1 root root   2965944 Feb 23  2021 lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvmconfig -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvmdiskscan -> lvm
-rwxr-xr-x  1 root root     10312 Feb 23  2021 lvmdump
-rwxr-xr-x  1 root root    233520 Feb 23  2021 lvmpolld
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvmsadc -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvmsar -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvreduce -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvremove -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvrename -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvresize -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvs -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 lvscan -> lvm
-rwxr-xr-x  1 root root     27648 Oct  2  2020 mii-tool
lrwxrwxrwx  1 root root         8 Feb  8  2021 mkdosfs -> mkfs.fat
-rwxr-xr-x  1 root root    141792 Jun  7  2021 mke2fs
-rwxr-xr-x  1 root root     57344 Jul  5  2020 mkexfatfs
-rwxr-xr-x  1 root root     14568 Jan 21  2022 mkfs
-rwxr-xr-x  1 root root     35048 Jan 21  2022 mkfs.bfs
-rwxr-xr-x  1 root root     43176 Jan 21  2022 mkfs.cramfs
lrwxrwxrwx  1 root root         9 Jul  5  2020 mkfs.exfat -> mkexfatfs
lrwxrwxrwx  1 root root         6 Jun  7  2021 mkfs.ext2 -> mke2fs
lrwxrwxrwx  1 root root         6 Jun  7  2021 mkfs.ext3 -> mke2fs
lrwxrwxrwx  1 root root         6 Jun  7  2021 mkfs.ext4 -> mke2fs
-rwxr-xr-x  1 root root     64272 Feb  8  2021 mkfs.fat
-rwxr-xr-x  1 root root    112880 Jan 21  2022 mkfs.minix
lrwxrwxrwx  1 root root         8 Feb  8  2021 mkfs.msdos -> mkfs.fat
lrwxrwxrwx  1 root root         6 Nov  3  2022 mkfs.ntfs -> mkntfs
lrwxrwxrwx  1 root root         8 Feb  8  2021 mkfs.vfat -> mkfs.fat
-rwxr-xr-x  1 root root     22544 Aug 27  2021 mkhomedir_helper
-rwxr-xr-x  1 root root     84080 Nov  3  2022 mkntfs
-rwxr-xr-x  1 root root    108784 Jan 21  2022 mkswap
lrwxrwxrwx  1 root root         9 Jan  8  2021 modinfo -> /bin/kmod
lrwxrwxrwx  1 root root         9 Jan  8  2021 modprobe -> /bin/kmod
-rwxr-xr-x  1 root root     51568 Jun 29  2020 mount.exfat-fuse
-rwxr-xr-x  1 root root     14328 Feb 27  2021 mount.fuse
lrwxrwxrwx  1 root root        15 Nov  3  2022 mount.lowntfs-3g -> /bin/lowntfs-3g
lrwxrwxrwx  1 root root        13 Nov  3  2022 mount.ntfs -> mount.ntfs-3g
lrwxrwxrwx  1 root root        12 Nov  3  2022 mount.ntfs-3g -> /bin/ntfs-3g
-rwxr-xr-x  1 root root     19128 Oct  2  2020 nameif
-rwxr-xr-x  1 root root     26696 Jan 11 10:00 nft
-rwxr-xr-x  1 root root     59512 Nov  3  2022 ntfsclone
-rwxr-xr-x  1 root root     39016 Nov  3  2022 ntfscp
-rwxr-xr-x  1 root root     34920 Nov  3  2022 ntfslabel
-rwxr-xr-x  1 root root     79992 Nov  3  2022 ntfsresize
-rwxr-xr-x  1 root root     51304 Nov  3  2022 ntfsundelete
-rwxr-xr-x  1 root root      2228 Jul 21  2019 on_ac_power
-rwxr-xr-x  1 root root     84064 Jan 30  2021 parted
-rwxr-xr-x  1 root root     14408 Jan 30  2021 partprobe
-rwxr-xr-x  1 root root     14568 Jan 21  2022 pivot_root
-rwxr-xr-x  1 root root     14768 Oct  2  2020 plipconfig
lrwxrwxrwx  1 root root        14 Jun 18  2023 poweroff -> /bin/systemctl
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvchange -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvck -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvcreate -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvdisplay -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvmove -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvremove -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvresize -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvs -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 pvscan -> lvm
-rwxr-xr-x  1 root root     37976 Oct  2  2020 rarp
-rwxr-xr-x  1 root root     14568 Jan 21  2022 raw
lrwxrwxrwx  1 root root        14 Jun 18  2023 reboot -> /bin/systemctl
-rwxr-xr-x  1 root root     14496 Apr  1  2020 regdbdump
-rwxr-xr-x  1 root root     63720 Jun  7  2021 resize2fs
lrwxrwxrwx  1 root root         9 Jan  8  2021 rmmod -> /bin/kmod
-rwxr-xr-x  1 root root     70784 Oct  2  2020 route
-rwxr-xr-x  1 root root     49448 Feb  6  2021 rtacct
-rwxr-xr-x  1 root root     80120 Feb  6  2021 rtmon
lrwxrwxrwx  1 root root        14 Jun 18  2023 runlevel -> /bin/systemctl
-rwxr-xr-x  1 root root     71912 Jan 21  2022 runuser
-rwxr-xr-x  1 root root     14488 Oct 15  2020 setcap
-rwxr-xr-x  1 root root    145640 Jan 21  2022 sfdisk
-rwxr-xr-x  1 root root    207184 Feb  9  2021 sgdisk
-rwxr-xr-x  1 root root       885 Feb  7  2020 shadowconfig
lrwxrwxrwx  1 root root        14 Jun 18  2023 shutdown -> /bin/systemctl
-rwxr-xr-x  1 root root     46264 Oct  2  2020 slattach
-rwxr-xr-x  1 root root     44232 Sep 14 06:38 start-stop-daemon
-rwxr-xr-x  1 root root     47336 Jan 21  2022 sulogin
-rwxr-xr-x  1 root root     18664 Jan 21  2022 swaplabel
-rwxr-xr-x  1 root root     22752 Jan 21  2022 swapoff
-rwxr-xr-x  1 root root     51432 Jan 21  2022 swapon
-rwxr-xr-x  1 root root     14568 Jan 21  2022 switch_root
-rwxr-xr-x  1 root root     30952 Apr  6  2021 sysctl
-rwxr-xr-x  1 root root    571304 Feb  6  2021 tc
lrwxrwxrwx  1 root root        14 Jun 18  2023 telinit -> /bin/systemctl
-rwxr-xr-x  1 root root    129264 Feb  6  2021 tipc
-rwxr-xr-x  1 root root    113056 Jun  7  2021 tune2fs
-rwxr-xr-x  1 root root     14488 Nov  5  2021 umount.udisks2
-rwxr-sr-x  1 root shadow   38912 Aug 27  2021 unix_chkpwd
-rwxr-xr-x  1 root root     38912 Aug 27  2021 unix_update
-rwxr-xr-x  1 root root     61200 Feb  1  2022 veritysetup
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgcfgbackup -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgcfgrestore -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgchange -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgck -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgconvert -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgcreate -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgdisplay -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgexport -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgextend -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgimport -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgimportclone -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgmerge -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgmknodes -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgreduce -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgremove -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgrename -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgs -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgscan -> lvm
lrwxrwxrwx  1 root root         3 Feb 23  2021 vgsplit -> lvm
-rwxr-xr-x  1 root root     47336 Jan 21  2022 wipefs
-rwxr-xr-x  1 root root      1735 Feb 26  2021 wpa_action
-rwxr-xr-x  1 root root    155720 Feb 26  2021 wpa_cli
-rwxr-xr-x  1 root root   2929840 Feb 26  2021 wpa_supplicant
-rwxr-xr-x  1 root root    117088 Jan 21  2022 zramctl

Do you remember if this template was upgraded in-place from Debian 9 while you were using Qubes 4.0? The merge was done in Debian 10 iirc.

You should probably recreate the template using the debian-12-xfce template instead of editing things in the current one. Since it’s a very old template, it might have some other old stuff like this still present and it’s not worth finding all of them.

If I recall correctly, that particular template migrated from my R3.2 install which may have been Debian 7 or 8. I manually upgraded this template several times following the Qubes docs (never an upgrade script until 4.2). I have a lot of customization in there that is used for some very specific control of external radio equipment. Up until now it has just worked…

However, I agree that it makes sense to bite the bullet and do a full refresh of that template. Until now I didn’t realize all of the cruft that has accumulated in that template over the years.

If the template works for your usage, it’s fine to use it as is. If you still want to try to fix this problem specifically, you could clone the template and try your luck by installing the usrmerge package.

https://wiki.debian.org/UsrMerge

1 Like