Booting delay with Gateway

I just wanted to report a delay that happens when Whonix Gateway is booted. The hang is about 25 seconds long, and then boot continues without error and everything is working fine.
user@host:~$ systemd-analyze critical-chain
graphical.target @13.502s
└─multi-user.target @13.502s
└─sdwdate.service @11.828s +1.673s
└─tor@default.service @8.453s +3.370s
└─network.target @8.446s
└─networking.service @8.230s +214ms
└─network-pre.target @8.228s

from syslog:
Dec 11 16:20:35 host kernel: [ 2.642136] cdrom: Uniform CD-ROM driver Revision: 3.20
Dec 11 16:20:35 host kernel: [ 2.645047] sr 1:0:0:0: Attached scsi CD-ROM sr0
Dec 11 16:20:35 host kernel: [ 34.891101] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
Dec 11 16:20:35 host kernel: [ 34.938866] systemd-udevd: 37 output lines suppressed due to ratelimiting
Dec 11 16:20:35 host augenrules[450]: failure 1

user@host:~$ systemd-analyze time
Startup finished in 36.024s (kernel) + 13.515s (userspace) = 49.539s
graphical.target reached after 13.502s in userspace

Edit: tty and time error messages were not relevant. see final reply for solution

see last reply for solution

Add 2 GB or more RAM. Does that help?

Reason: Whonix-Gateway VirtualBox by default comes with 768 MB RAM.
(Whonix-Workstation with 2048 MB RAM.)

That works great most of the time but Whonix-Gateway happened to freeze during apt (kernel) upgrades due to low RAM. Adding more default RAM to Whonix-Gateway wasn’t an option since that would break Whonix by default for many users who don’t have that much RAM.

As solution swap-file-creator was created. If there is less than (default, configureable) 1950 MB RAM, it will create an encrypted swap file. If more than that, it will not create a swap file. Swap file creation at boot takes some time. This makes Whonix-Gateway boot slower than Whonix-Workstation.

Patrick,
Thank you for the awesome reply! I will try the serial-console-enable package.

see final update at bottom for solution

Final Update: Success!

The “solution” was simply purging the current copy of V-box via apt. The actual delay was caused by the swap-file-creator application. It takes some time to start which is completely normal. In this particular case, there was some issue with the vbox software that was resolved after a purge and re-download.
Thank you to Patrick for the suggestions

1 Like

Maybe remove the swap-file-creator package completely? Or if it is possible, have it be an opt-in for those who may need it?
For my uses, I have not really touched the defaults that the machines ship with. A couple times I tried 1024K for Gateway’s RAM, but it was not necessary. I found the default 768M to be quite enough. I have not had a situation where swap was needed on either machine.

It was removed completely before.

But then it was fully reproducible that the gateway hangs with 768 MB RAM without any swap. See:

When there’s enough RAM (2000 MB or more), swap-file-creator will do nothing at all.

1 Like

Here are my observations; I cloned my machines and decided to experiment a bit;
System host: Debian Buster, fully up to date
Virtualizer: Vbox version 6.0.14 from Oracle site
Settings: default 768M Gateway Ram and 2048K Workstation Ram
Findings: With the removal of xdg-dbus-proxy bubblewrap swap-file-creator, cryptsetup-initramfs and all the suggestions through the apt-get purge command and then rebuilding and updating the initramfs, I have the Gateway booting properly without delay. I used an older snapshot version of Whonix (15.0.0.4.9) so the apt-get dist-upgrade could be tested. No issue reported and it updated without issue
An important note is this may not be ideal because 2 meta packages were removed and we may use bubblewrap in the future. But as far as functionality, with the removal of those packages and rebuild of initramfs, the booting issue disappears.
I have not tested other virtualizers, just this specific virtualbox version so far.

Solution is really simple. See here:

1 Like