1

I'm trying to use the vidcontrol utility to change VT on FreeBSD 13.0-RELEASE, but it doesn't do anything. After roughly an hour of tryingto find out why, I had a look at the executable and it's just a shell script that does nothing.

kettle in ~$ cat /usr/sbin/vidcontrol
#!/bin/sh
exit 0

Where can I get the actual vidcontrol?

1 Answer 1

3

vidcontrol(1) is part of the base operating system in FreeBSD, and thus is not part of any package. It appears that something or someone clobbered your file to make it a no-op.

You can retrieve the vidcontrol binary from the FreeBSD-13.0-RELEASE-*.iso file that you installed from (perhaps on a USB stick or optical media). If you no longer have convenient access to the installation media you used, downloading the bootonly ISO will suffice:

$ ftp [email protected]
Trying 204.15.11.115:21 ...
Connected to ftp.geo.freebsd.org.
220 This is ftp0.tuk.freebsd.org - hosted at MetaPeer http://www.metapeer.com
331 Please specify the password.
Password:
230-
230-This is ftp0.tuk.FreeBSD.org, graciously hosted by ZI IN A LOCATION TBD.
230-
230-FreeBSD files can be found in the /pub/FreeBSD directory.
230-
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /pub/FreeBSD/releases/ISO-IMAGES/13.0/
250 Directory successfully changed.
ftp> get FreeBSD-13.0-RELEASE-amd64-bootonly.iso
local: FreeBSD-13.0-RELEASE-amd64-bootonly.iso remote: FreeBSD-13.0-RELEASE-amd64-bootonly.iso
229 Entering Extended Passive Mode (|||60919|)
150 Opening BINARY mode data connection for FreeBSD-13.0-RELEASE-amd64-bootonly.iso (363548672 bytes).
100% |***************************************************************************|   346 MiB   84.58 MiB/s    00:00 ETA
226 Transfer complete.
363548672 bytes received in 00:04 (83.59 MiB/s)
ftp> quit
221 Goodbye.

Then use tar(1) to identify and extract the file you need:

$ tar tvf FreeBSD-13.0-RELEASE-amd64-bootonly.iso | grep vidcontrol
-r-xr-xr-x  1 0      0       28456 Apr  9 00:26 usr/sbin/vidcontrol
-r--r--r--  1 0      0        6154 Apr  9 00:26 usr/share/man/man1/vidcontrol.1.gz

I will presume that your /tmp directory does not contain a file or directory /tmp/usr. If it does, set it aside temporarily or rm -rf it.

$ tar xpf FreeBSD-13.0-RELEASE-amd64-bootonly.iso -C /tmp usr/sbin/vidcontrol

Finally, inspect /tmp/usr/sbin/vidcontrol and try running it. If it looks good, move it into /usr/sbin:

$ sudo chown root:wheel /tmp/usr/sbin/vidcontrol
$ sudo mv /tmp/usr/sbin/vidcontrol /usr/sbin/

There are some additional steps that could be taken out of an abundance of caution, such as verifying the sha256 of the ISO file before you extract from it, but that's the gist of the process.

2
  • Thank you. I was worried I might have to reinstall entirely, I'll use the bootonly image. Also, I have never used the ftp utility (thanks to nautilus) but I should be alright.
    – kettle
    May 11, 2021 at 6:59
  • Wait, your computer downloaded it in 4 seconds?!
    – kettle
    May 12, 2021 at 4:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .