swap file creator error

Hello. I have been having this problem for a long time. I used to use virtualbox 7.0.2, now I switched to the latest version of vbox 7.1.4 but this problem remains.

Guest addons are installed from debian standard repository, version 7.0.12_Debianr159484.
All system packages are up to date.
Guest add-ons functions work (copying to clipboard).

1.jpg

How to fix this problem?

sudo bash -x /usr/share/swap-file-creator/swap-file-creator

+ set -e
+ set -o pipefail
+ set -o errtrace
+ set -o nounset
+ trap error_handler ERR
++ grep --only-matching --fixed-strings -e boot=live -e root=live -e rootovl -e rd.live.overlay.overlayfs=1 -e rd.live.image /proc/cmdline
+ grep_result=
+ sanity_tests
+ command -v cryptsetup
+ command -v mkdir
+ command -v rm
+ command -v chown
+ command -v mkswap
+ command -v swapon
+ command -v swapoff
+ command -v shred
+ command -v cat
+ command -v test
+ command -v echo
+ command -v stat
+ command -v /usr/lib/systemd/systemd-cryptsetup
+ source_config_file
+ '[' -f /etc/default/swap-file-creator ']'
+ bash -n /etc/default/swap-file-creator
+ source /etc/default/swap-file-creator
+ set_defaults
+ [[ -v DESC ]]
+ DESC='Encrypted Swap File Creator'
+ [[ -v NAME ]]
+ NAME=swap-file-creator
+ [[ -v SWAPFILE ]]
+ SWAPFILE=/var/swapfile
+ [[ -v VERBOSE ]]
+ VERBOSE=yes
+ [[ -v UUID ]]
+ UUID=0615ba72-85b0-4183-8d54-300bb0d2e491
+ [[ -v MAPPER ]]
+ MAPPER=swapfile
+ [[ -v MAPPER_FULL ]]
+ MAPPER_FULL=/dev/mapper/swapfile
+ [[ -v RUN_FOLDER ]]
+ RUN_FOLDER=/run/swap-file-creator
+ [[ -v cryptsetup_pre_wrapper ]]
+ cryptsetup_pre_wrapper=ld-system-preload-disable
+ [[ -v SWAPON_EXTRA ]]
+ SWAPON_EXTRA=
+ [[ -v MKSWAP_EXTRA ]]
+ MKSWAP_EXTRA=
+ [[ -v SHRED_ON_STOP ]]
+ SHRED_ON_STOP=no
+ [[ -v SHRED_OPTS ]]
+ SHRED_OPTS='--verbose --iterations=1'
+ [[ -v RANDOM_DEVICE ]]
+ RANDOM_DEVICE=/dev/random
+ [[ -v ENOUGH_RAM ]]
+ ENOUGH_RAM=1950
+ [[ -v SWAP_FILE_SIZE_CUSTOM_MB ]]
+ SWAP_FILE_SIZE_CUSTOM_MB=
+ '[' 0 -eq 0 ']'
+ echo 'ERROR: No arguments provided.'
ERROR: No arguments provided.
+ echo 'Usage: /usr/share/swap-file-creator/swap-file-creator [start|stop]'
Usage: /usr/share/swap-file-creator/swap-file-creator [start|stop]
+ exit 1
zsh: exit 1     sudo bash -x /usr/share/swap-file-creator/swap-file-creator

Please run:

sudo bash -x /usr/share/swap-file-creator/swap-file-creator start
+ set -e
+ set -o pipefail
+ set -o errtrace
+ set -o nounset
+ trap error_handler ERR
++ grep --only-matching --fixed-strings -e boot=live -e root=live -e rootovl -e rd.live.overlay.overlayfs=1 -e rd.live.image /proc/cmdline
+ grep_result=
+ sanity_tests
+ command -v cryptsetup
+ command -v mkdir
+ command -v rm
+ command -v chown
+ command -v mkswap
+ command -v swapon
+ command -v swapoff
+ command -v shred
+ command -v cat
+ command -v test
+ command -v echo
+ command -v stat
+ command -v /usr/lib/systemd/systemd-cryptsetup
+ source_config_file
+ '[' -f /etc/default/swap-file-creator ']'
+ bash -n /etc/default/swap-file-creator
+ source /etc/default/swap-file-creator
+ set_defaults
+ [[ -v DESC ]]
+ DESC='Encrypted Swap File Creator'
+ [[ -v NAME ]]
+ NAME=swap-file-creator
+ [[ -v SWAPFILE ]]
+ SWAPFILE=/var/swapfile
+ [[ -v VERBOSE ]]
+ VERBOSE=yes
+ [[ -v UUID ]]
+ UUID=0615ba72-85b0-4183-8d54-300bb0d2e491
+ [[ -v MAPPER ]]
+ MAPPER=swapfile
+ [[ -v MAPPER_FULL ]]
+ MAPPER_FULL=/dev/mapper/swapfile
+ [[ -v RUN_FOLDER ]]
+ RUN_FOLDER=/run/swap-file-creator
+ [[ -v cryptsetup_pre_wrapper ]]
+ cryptsetup_pre_wrapper=ld-system-preload-disable
+ [[ -v SWAPON_EXTRA ]]
+ SWAPON_EXTRA=
+ [[ -v MKSWAP_EXTRA ]]
+ MKSWAP_EXTRA=
+ [[ -v SHRED_ON_STOP ]]
+ SHRED_ON_STOP=no
+ [[ -v SHRED_OPTS ]]
+ SHRED_OPTS='--verbose --iterations=1'
+ [[ -v RANDOM_DEVICE ]]
+ RANDOM_DEVICE=/dev/random
+ [[ -v ENOUGH_RAM ]]
+ ENOUGH_RAM=1950
+ [[ -v SWAP_FILE_SIZE_CUSTOM_MB ]]
+ SWAP_FILE_SIZE_CUSTOM_MB=
+ '[' 1 -eq 0 ']'
+ case "$1" in
+ do_start
+ echo 'INFO: swap-file-creator...'
INFO: swap-file-creator...
+ systemd_detect_virt_output=
+ command -v systemd-detect-virt
++ systemd-detect-virt
+ systemd_detect_virt_output=oracle
+ hibernation_consideration=no
+ [[ -v HIBERNATION ]]
+ HIBERNATION=no
++ free -m
++ sed -n -e '/^Mem:/s/^[^0-9]*\([0-9]*\) .*/\1/p'
+ total_ram_in_mb=4916
+ local swap_file_actual_size_in_bytes
+ '[' -f /var/swapfile ']'
+ swap_file_actual_size_in_bytes=0
+ local folder_of_swapfile
+ folder_of_swapfile=/var
+ test -d /var
+ test -w /var
+ local swap_file_actual_size_in_mb
+ swap_file_actual_size_in_mb=0
+ swap_file_actual_size_in_mb=2
+ '[' 4916 -ge 1950 ']'
+ echo 'INFO: Enough RAM available. More than 1950 MB RAM. OK.'
INFO: Enough RAM available. More than 1950 MB RAM. OK.
+ local dirname_swapfile
+ local total_disk_space_in_mb
+ dirname_swapfile=/var
++ df /var
++ awk 'NR==2 {print int($2/1024)}'
+ total_disk_space_in_mb=100216
+ local swap_file_target_size_mb
+ '[' '' = '' ']'
+ local calculate_swap_size_report
++ calculate-swap-size 4916 100216 no
+ calculate_swap_size_report='Calculating swap size...
RAM in MB: 4916
Disk size in MB: 100216
Hibernation considered: no
RAM in GB (approximated for calculation): 4
RAM > 2GB and <= 8GB without hibernation: Swap size equals RAM
Calculated Swap Size in MB: 4916'
+ echo 'Calculating swap size...
RAM in MB: 4916
Disk size in MB: 100216
Hibernation considered: no
RAM in GB (approximated for calculation): 4
RAM > 2GB and <= 8GB without hibernation: Swap size equals RAM
Calculated Swap Size in MB: 4916'
Calculating swap size...
RAM in MB: 4916
Disk size in MB: 100216
Hibernation considered: no
RAM in GB (approximated for calculation): 4
RAM > 2GB and <= 8GB without hibernation: Swap size equals RAM
Calculated Swap Size in MB: 4916
++ tail -1
++ awk '{print $NF}'
+ swap_file_target_size_mb=4916
+ local swap_file_size_gb
++ echo 'scale=0; 4916 / 1024'
++ bc
+ swap_file_size_gb=4
+ local free_disk_space_in_gb
+ local free_disk_space_in_gb_plus
++ df /var
++ awk 'NR==2 {print int($4/1024/1024)}'
+ free_disk_space_in_gb=72
+ free_disk_space_in_gb_plus=74
+ '[' oracle = xen ']'
+ '[' 4 -ge 74 ']'
+ local swap_file_target_size_bytes=4916000000
+ local swap_file_target_size_gb
++ echo 'scale=2; 4916000000/1024/1024/1024'
++ bc
+ swap_file_target_size_gb=4.57
++ printf %.0f 4.57
/usr/share/swap-file-creator/swap-file-creator: строка 195: printf: 4.57: недопустимое число
+++ error_handler
+++ local exit_code=1
+++ trap '' ERR
+++ echo '###############################################################################
## Swap File Creator ERROR
## /usr/share/swap-file-creator/swap-file-creator
##
## BASH_COMMAND: printf "%.0f" "$swap_file_target_size_gb"
## exit_code: 1
##
## For debugging, please run:
## bash -x /usr/share/swap-file-creator/swap-file-creator
##
## Clean the output and submit to developers.
###############################################################################'
###############################################################################
## Swap File Creator ERROR
## /usr/share/swap-file-creator/swap-file-creator
##
## BASH_COMMAND: printf "%.0f" "$swap_file_target_size_gb"
## exit_code: 1
##
## For debugging, please run:
## bash -x /usr/share/swap-file-creator/swap-file-creator
##
## Clean the output and submit to developers.
###############################################################################
+++ exit 1
+ swap_file_target_size_gb=4
++ error_handler
++ local exit_code=1
++ trap '' ERR
++ echo '###############################################################################
## Swap File Creator ERROR
## /usr/share/swap-file-creator/swap-file-creator
##
## BASH_COMMAND: swap_file_target_size_gb=$(printf "%.0f" "$swap_file_target_size_gb")
## exit_code: 1
##
## For debugging, please run:
## bash -x /usr/share/swap-file-creator/swap-file-creator
##
## Clean the output and submit to developers.
###############################################################################'
###############################################################################
## Swap File Creator ERROR
## /usr/share/swap-file-creator/swap-file-creator
##
## BASH_COMMAND: swap_file_target_size_gb=$(printf "%.0f" "$swap_file_target_size_gb")
## exit_code: 1
##
## For debugging, please run:
## bash -x /usr/share/swap-file-creator/swap-file-creator
##
## Clean the output and submit to developers.
###############################################################################
++ exit 1
zsh: exit 1     sudo bash -x /usr/share/swap-file-creator/swap-file-creator start

1 Like

How can this be fixed?

Likely fixed in source code / git / developers repository.

Will be included in the next release.