Error building Whonix gateway on physical hardware

Hi, im having trouble building Whonix-gateway for a physical machine. I followed the instructions on the wiki step by step, got the source code for Whonix 13 / Jessie including git submodules, and checkout version 13.0.0.1.4-stable. Build was made with the default sudo ./whonix_build --flavor whonix-gateway – --target root --build >> ~/log-phyiso 2>&1. However, I always get an ERROR when running command test -f “$gpg_temp_dir/pubring.gpg”. I tried to make the build on a freshly debian 8.8 netinstall, as well as on a debian 9 fresh install (both 32 bit).

Heres the last300 lnes of the log:

gpg: no ultimately trusted keys found

  • gpg --no-options --no-default-keyring --homedir /tmp/tmp.22nOkDCYfA --fingerprint
    /tmp/tmp.22nOkDCYfA/pubring.kbx

pub rsa2048 2009-09-04 [SC] [expires: 2020-08-29]
A3C4 F0F9 79CA A22C DBA8 F512 EE8C BC9E 886D DD89
uid [ unknown] deb.torproject.org archive signing key
sub rsa2048 2009-09-04 [S] [expires: 2018-08-30]

  • test -f /tmp/tmp.22nOkDCYfA/pubring.gpg
    ++ errorhandlergeneral ERR
    ++ last_failed_exit_code=1
    ++ last_failed_bash_command=‘test -f “$gpg_temp_dir/pubring.gpg”’
    ++ output_cmd_set
    ++ ‘[’ -o xtrace ‘]’
    ++ output_cmd=echo
    ++ echo ‘INFO: Middle of function errorhandlergeneral of ././build-steps.d/1200_create-debian-packages.’
    INFO: Middle of function errorhandlergeneral of ././build-steps.d/1200_create-debian-packages.
    ++ errorhandlerprocessshared ERR
    ++ last_script=././build-steps.d/1200_create-debian-packages
    ++ trap_signal_type_previous=
    ++ ‘[’ ‘’ = ‘’ ‘]’
    ++ trap_signal_type_previous=unset
    ++ trap_signal_type_last=ERR
    ++ whonix_build_error_counter=1
    +++ benchmarktimeend 1501137664
    ++++ date +%s
    +++ benchmarktimeend=1501137670
    +++ benchmark_took_seconds=6
    ++++ convertsecs 6
    ++++ local h m s
    ++++ (( h=6/3600 ))
    ++++ true
    ++++ (( m=(6%3600)/60 ))
    ++++ true
    ++++ (( s=6%60 ))
    ++++ printf ‘%02d:%02d:%02d\n’ 0 0 6
    +++ echo 00:00:06
    ++ benchmark_took_time=00:00:06
    ++ processbacktracefunction
    ++ echo ‘INFO: BEGIN: processbacktracefunction’
    INFO: BEGIN: processbacktracefunction
    ++ ‘[’ -o xtrace ‘]’
    ++ set +x
    ++ echo ‘INFO: END : processbacktracefunction’
    INFO: END : processbacktracefunction
    ++ functiontracefunction
    ++ echo ‘INFO: BEGIN: functiontracefunction’
    INFO: BEGIN: functiontracefunction
    ++ ‘[’ -o xtrace ‘]’
    ++ set +x
    ++ echo ‘INFO: END : functiontracefunction’
    INFO: END : functiontracefunction
    ++ echo ’
    ############################################################
    ERROR in ././build-steps.d/1200_create-debian-packages detected!
    anon_dist_build_version: 13.0.0.1.4
    (whonix_build_error_counter: 1)
    (benchmark: 00:00:06)
    trap_signal_type_previous: unset
    trap_signal_type_last : ERR
    process_backtrace_result:
    1: : /sbin/init
    2: : /bin/login –
    3: : -bash
    4: : sudo ./whonix_build --flavor whonix-gateway – --target root --build
    5: : /bin/bash ./whonix_build --flavor whonix-gateway – --target root --build
    6: : /bin/bash ./help-steps/whonix_build_one --flavor whonix-gateway --target root --build
    7: : /bin/bash ././build-steps.d/1200_create-debian-packages
    function_trace_result:
    main (line number: 408)
    main (line number: 404)
    create-debian-packages (line number: 394)
    get_tpo_packages (line number: 157)
    errorhandlergeneral (line number: 323)
    errorhandlerprocessshared (line number: 170)
    last_failed_bash_command: test -f “$gpg_temp_dir/pubring.gpg”
    last_failed_exit_code: 1
    ERROR in ././build-steps.d/1200_create-debian-packages detected!
    ############################################################

############################################################
ERROR in ././build-steps.d/1200_create-debian-packages detected!
anon_dist_build_version: 13.0.0.1.4
(whonix_build_error_counter: 1)
(benchmark: 00:00:06)
trap_signal_type_previous: unset
trap_signal_type_last : ERR
process_backtrace_result:
1: : /sbin/init
2: : /bin/login –
3: : -bash
4: : sudo ./whonix_build --flavor whonix-gateway – --target root --build
5: : /bin/bash ./whonix_build --flavor whonix-gateway – --target root --build
6: : /bin/bash ./help-steps/whonix_build_one --flavor whonix-gateway --target root --build
7: : /bin/bash ././build-steps.d/1200_create-debian-packages
function_trace_result:
main (line number: 408)
main (line number: 404)
create-debian-packages (line number: 394)
get_tpo_packages (line number: 157)
errorhandlergeneral (line number: 323)
errorhandlerprocessshared (line number: 170)
last_failed_bash_command: test -f “$gpg_temp_dir/pubring.gpg”
last_failed_exit_code: 1
ERROR in ././build-steps.d/1200_create-debian-packages detected!
############################################################

++ ‘[’ ERR = INT ‘]’
++ ‘[’ ERR = TERM ‘]’
++ ‘[’ ERR = ERR ‘]’
++ echo ‘INFO: trap_signal_type_last: ERR, considering auto retry…’
INFO: trap_signal_type_last: ERR, considering auto retry…
++ ‘[’ ‘!’ 1 = 0 ‘]’
++ ‘[’ ‘’ = ‘’ ‘]’
++ whonix_build_auto_retry_counter=1
++ ‘[’ -n 1 ‘]’
++ ‘[’ -n 5 ‘]’
++ local first
++ read -r first _
++ ‘[’ test = error_ ‘]’
++ ‘[’ 1 -gt 1 ‘]’
++ echo 'INFO: Auto retry attempt number: 1. Max retry attempts: 1 (–retry-max). Auto retry… ’
INFO: Auto retry attempt number: 1. Max retry attempts: 1 (–retry-max). Auto retry…
++ whonix_build_auto_retry_counter=2
++ ‘[’ ‘!’ 5 = 0 ‘]’
++ echo 'INFO: Waiting (–retry-wait) 5 seconds before auto retry… ’
INFO: Waiting (–retry-wait) 5 seconds before auto retry…
++ wait 30371
++ sleep 5
++ ignore_error=echo
++ error_handler_do_retry=echo
++ errorhandlerretry
++ ‘[’ ‘!’ ‘’ = ‘’ ‘]’
++ echo ‘INFO: Skipping whonix_build_dispatch_before_retry (–retry-before), because empty, ok.’
INFO: Skipping whonix_build_dispatch_before_retry (–retry-before), because empty, ok.
++ echo 'INFO: Retrying last_failed_bash_command…: test -f “$gpg_temp_dir/pubring.gpg” ’
INFO: Retrying last_failed_bash_command…: test -f “$gpg_temp_dir/pubring.gpg”
++ retry_last_failed_bash_command_exit_code=0
++ eval test -f ‘“$gpg_temp_dir/pubring.gpg”’
+++ test -f /tmp/tmp.22nOkDCYfA/pubring.gpg
++ retry_last_failed_bash_command_exit_code=1
++ true
++ ‘[’ 1 = 0 ‘]’
++ echo 'INFO: Retry failed. exit code of last_failed_bash_command: 1 ’
INFO: Retry failed. exit code of last_failed_bash_command: 1
++ last_failed_exit_code=1
++ last_failed_bash_command=‘test -f “$gpg_temp_dir/pubring.gpg”’
++ ‘[’ ‘!’ ‘’ = ‘’ ‘]’
++ echo ‘INFO: Skipping whonix_build_dispatch_after_retry (–retry-after), because empty, ok.’
INFO: Skipping whonix_build_dispatch_after_retry (–retry-after), because empty, ok.
++ ‘[’ 1 = 0 ‘]’
++ errorhandlerprocessshared ‘NONE_(called_by_errorhandlerretry)’
++ last_script=././build-steps.d/1200_create-debian-packages
++ trap_signal_type_previous=ERR
++ ‘[’ ERR = ‘’ ‘]’
++ trap_signal_type_last=‘NONE_(called_by_errorhandlerretry)’
++ whonix_build_error_counter=2
+++ benchmarktimeend 1501137664
++++ date +%s
+++ benchmarktimeend=1501137675
+++ benchmark_took_seconds=11
++++ convertsecs 11
++++ local h m s
++++ (( h=11/3600 ))
++++ true
++++ (( m=(11%3600)/60 ))
++++ true
++++ (( s=11%60 ))
++++ printf ‘%02d:%02d:%02d\n’ 0 0 11
+++ echo 00:00:11
++ benchmark_took_time=00:00:11
++ processbacktracefunction
++ echo ‘INFO: BEGIN: processbacktracefunction’
INFO: BEGIN: processbacktracefunction
++ ‘[’ -o xtrace ‘]’
++ set +x
++ echo ‘INFO: END : processbacktracefunction’
INFO: END : processbacktracefunction
++ functiontracefunction
++ echo ‘INFO: BEGIN: functiontracefunction’
INFO: BEGIN: functiontracefunction
++ ‘[’ -o xtrace ‘]’
++ set +x
++ echo ‘INFO: END : functiontracefunction’
INFO: END : functiontracefunction
++ echo ’
############################################################
ERROR in ././build-steps.d/1200_create-debian-packages detected!
anon_dist_build_version: 13.0.0.1.4
(whonix_build_error_counter: 2)
(benchmark: 00:00:11)
trap_signal_type_previous: ERR
trap_signal_type_last : NONE_(called_by_errorhandlerretry)
process_backtrace_result:
1: : /sbin/init
2: : /bin/login –
3: : -bash
4: : sudo ./whonix_build --flavor whonix-gateway – --target root --build
5: : /bin/bash ./whonix_build --flavor whonix-gateway – --target root --build
6: : /bin/bash ./help-steps/whonix_build_one --flavor whonix-gateway --target root --build
7: : /bin/bash ././build-steps.d/1200_create-debian-packages
function_trace_result:
main (line number: 408)
main (line number: 404)
create-debian-packages (line number: 394)
get_tpo_packages (line number: 157)
errorhandlergeneral (line number: 323)
errorhandlerprocessshared (line number: 220)
errorhandlerretry (line number: 155)
errorhandlerprocessshared (line number: 170)
errorhandlerprocessshared (line number: 170)
errorhandlergeneral (line number: 323)
get_tpo_packages (line number: 157)
create-debian-packages (line number: 394)
main (line number: 404)
main (line number: 408)
last_failed_bash_command: test -f “$gpg_temp_dir/pubring.gpg”
last_failed_exit_code: 1
ERROR in ././build-steps.d/1200_create-debian-packages detected!
############################################################

############################################################
ERROR in ././build-steps.d/1200_create-debian-packages detected!
anon_dist_build_version: 13.0.0.1.4
(whonix_build_error_counter: 2)
(benchmark: 00:00:11)
trap_signal_type_previous: ERR
trap_signal_type_last : NONE_(called_by_errorhandlerretry)
process_backtrace_result:
1: : /sbin/init
2: : /bin/login –
3: : -bash
4: : sudo ./whonix_build --flavor whonix-gateway – --target root --build
5: : /bin/bash ./whonix_build --flavor whonix-gateway – --target root --build
6: : /bin/bash ./help-steps/whonix_build_one --flavor whonix-gateway --target root --build
7: : /bin/bash ././build-steps.d/1200_create-debian-packages
function_trace_result:
main (line number: 408)
main (line number: 404)
create-debian-packages (line number: 394)
get_tpo_packages (line number: 157)
errorhandlergeneral (line number: 323)
errorhandlerprocessshared (line number: 220)
errorhandlerretry (line number: 155)
errorhandlerprocessshared (line number: 170)
errorhandlerprocessshared (line number: 170)
errorhandlergeneral (line number: 323)
get_tpo_packages (line number: 157)
create-debian-packages (line number: 394)
main (line number: 404)
main (line number: 408)
last_failed_bash_command: test -f “$gpg_temp_dir/pubring.gpg”
last_failed_exit_code: 1
ERROR in ././build-steps.d/1200_create-debian-packages detected!
############################################################

++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = INT ‘]’
++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = TERM ‘]’
++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = ERR ‘]’
++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = ‘NONE_(called_by_errorhandlerretry)’ ‘]’
++ echo ‘INFO: trap_signal_type_last: NONE_(called_by_errorhandlerretry), considering auto retry…’
INFO: trap_signal_type_last: NONE_(called_by_errorhandlerretry), considering auto retry…
++ ‘[’ ‘!’ 1 = 0 ‘]’
++ ‘[’ 2 = ‘’ ‘]’
++ ‘[’ -n 1 ‘]’
++ ‘[’ -n 5 ‘]’
++ local first
++ read -r first _
++ ‘[’ test = error_ ‘]’
++ ‘[’ 2 -gt 1 ‘]’
++ echo 'INFO: Auto retried (–retry-max) already 1 times. No more auto retry. ’
INFO: Auto retried (–retry-max) already 1 times. No more auto retry.
++ unset whonix_build_auto_retry_counter
++ ignore_error=false
++ answer=
++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = ERR ‘]’
++ ‘[’ ‘NONE_(called_by_errorhandlerretry)’ = ‘NONE_(called_by_errorhandlerretry)’ ‘]’
++ echo 'INFO: whonix_build_non_interactive: ’
INFO: whonix_build_non_interactive:
++ ‘[’ ‘’ = true ‘]’
++ ‘[’ -t 0 ‘]’
++ echo ‘INFO: stdin connected to terminal, using interactive error handler.’
INFO: stdin connected to terminal, using interactive error handler.
++ echo 'ERROR in ././build-steps.d/1200_create-debian-packages detected!
Please have a look above (the block within ###…), note the command that failed, last_failed_exit_code and its output (further above).

  • Please enter c and press enter to ignore the error and continue building. (Recommended against!)
  • Please press r and enter to retry.
  • Please press s and enter to open an chroot interactive shell.
  • Please press enter to cleanup and exit.’
    ERROR in ././build-steps.d/1200_create-debian-packages detected!
    Please have a look above (the block within ###…), note the command that failed, last_failed_exit_code and its output (further above).
  • Please enter c and press enter to ignore the error and continue building. (Recommended against!)
  • Please press r and enter to retry.
  • Please press s and enter to open an chroot interactive shell.
  • Please press enter to cleanup and exit.
    ++ read -p 'Answer? ’ answer
    Answer?

Anyone?

Up?

While I can’t currently help you with that specific problem it might be easier to start with the qcow2 vm image of the gateway and install some drivers to get it running on your hardware. Then convert it to raw and dd it to the hdd. I’ll add some documentation on this to the wiki the next days.

Thanks for your reply, I’ll try that and let you know how it goes.

Algernon,

I would like to see a tutorial on this! Please put one together for us. :slight_smile:

Tested with gateway 14.0.0.5.5.

Run:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install firmware-amd-graphics firmware-misc-nonfree firmware-realtek xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-radeon xserver-xorg-video-r128 xserver-xorg-video-mach64 macchanger

Change the config from eth0 in /etc/network/interfaces.d/30_non-qubes-whonix to the one you need i.e. setting the right address and gateway. Change /etc/resolv.conf respectively.
In /etc/network/interfaces.d/30_non-qubes-whonix you should maybe add the following lines below the eth1 config:
pre-up macchanger --mac=08:00:27:fc:cf:1b eth1
post-down macchanger -p eth1

so it looks like the mac address from virtualbox. Reason is here:

In /etc/whonix.d/30_whonixcheck_default.conf change
WHONIXCHECK_NO_EXIT_ON_UNSUPPORTED_VIRTUALIZER=“0”
to
WHONIXCHECK_NO_EXIT_ON_UNSUPPORTED_VIRTUALIZER=“1”

You maybe want to create the file /lib/udev/rules.d/70-persistent-net.rules with the following content (all in one line):
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

(change 00:11:22:33:44:55 to the mac address of the interface which connects to your upstream router)
This is not always required depending on how the interfaces come up on your system.

Power off the machine.
Convert the image from vmdk to raw:
sudo qemu-img convert -O raw “/path/to/vmdk” “/path/to/Whonix-Gateway-raw.img”

Burn it to a disk with the appropriate size (>100 GB) using your favorite utility. I used gnome-disk-utility. Also
sudo dd if=“/path/to/Whonix-Gateway-raw.img” of=/dev/sdb bs=1M
should work.
Change /dev/sdb to the name of your hard disk and don’t kill your main OS with dd :wink:

Boot it and hope for the best. On the workstation I changed the network to bridged and connected the cable to the gateway.
I tested it on several machines which are not that new anymore and don’t have efi. Each one booted fine but depending on your hardware you might need other drivers, a newer kernel or grub-efi.

1 Like

Changing that file is discouraged. /etc/whonix.d/50_whonixcheck_user.conf would be better.

Thanks, Algernon. Does it boot on any RasPi or Beagleboard machines?

No, you would need to build images from source for those boards. Take a look here: Whonix for arm64 / Raspberry Pi (RPi) - #17 by Algernon
Depending on your board you need a different architecture like armhf or armel.

Thanks for this post @Algernon, but I am unable to find the packages (firmware* and xserver*) should I add other repos for that?

What are the packages you could not find?

firmware-amd64-graphics is a typo, it should be just
firmware-amd-graphics. I can’t edit my earlier post, however.
I also did not test if the setup still works in general, though I guess it should. You might also want to try to build the new cli gateway instead.

Something like:
sudo ./whonix_build --target raw --flavor whonix-gateway-cli --build --arch amd64 --kernel linux-image-amd64 --headers linux-headers-amd64

2 Likes

Thanks for the reply. I was frustrated trying out stuff over and over again, ended up crashing atleast two VMs. :wink: but I believe not giving up is the whole point. Let me try both methods again.
@Algernon

That typo has been corrected. Hope you don’t mind.

3 Likes

I didnt had the repos in my debian.list @ /etc/apt/sources.d/.
Added

deb http://ftp.de.debian.org/debian stretch main non-free

and solved the issue for now.
right now ended up with the issue while am talking ,

This is a problem.

Make sure to use Whonix 14.

1 Like

Sure, Let me try with it.

espeakup most likely won’t be causing any issues - no longer included by default in Whonix 14.

I had been using the gateway image I downloaded couple years back. Guess I didnt get the memo :wink:

@Patrick also I am so sad that we still dont have enough contrib in Pi. I am also a Pi enthusiast. Want to contribute into it. Any pointer to where to start?

2 Likes