/usr/bin/file may not be available, while that has no high
probability we already had bug reports regarding this.
To ensure better compatibility use /bin/sh which every Linux
has (POSIX 1003.1-2004).
See: http://pubs.opengroup.org/onlinepubs/
009695399/utilities/sh.html
die $@ if $@ && !$no_unpack_error;
# determine file type of /usr/bin/file itself to get guests' architecture
- $cmd = [@$userns_cmd, '/usr/bin/file', '-b', '-L', "$rootdir/usr/bin/file"];
+ $cmd = [@$userns_cmd, '/usr/bin/file', '-b', '-L', "$rootdir/bin/sh"];
PVE::Tools::run_command($cmd, outfunc => sub {
shift =~ /^ELF (\d{2}-bit)/; # safely assumes x86 linux
my $arch_str = $1;