1

Can I use a 32-bit guest Ubuntu Virtual Machine on a 64-bit host Windows Machine in a Virtual Box?? And can I use the binary which is compiled for 32-bit Ubuntu in 64-bit guest Ubuntu Virtual Machine??? I am trying to execute a 32-bit binary file in a 64-bit guest Ubuntu VM with 64-bit Host Windows in a VB but I am getting an error everytime which tells me no such file or directory found even when the binary file is in the same directory in which I am in. Is this because I am using a 32-bit binary in a 64-bit guest VM or it is because of any other reason?? And the folder in which the binary file is,that folder I have shared with my host windows machine.So is it any problem with sharing of folders?? I can't really make out what the problem is?? Please help I have done ls -l and I got the following:-

raunak@raunak-VirtualBox:/media/base$ ls -l simg*

-rwxrwxrwx 1 root root     278374 Sep 14 15:56 simg2img
-rwxrwxrwx 1 root root       1947 Sep 15 17:39 simg2img.c
-rwxrwxrwx 1 root root       2634 Sep 15 17:39 simg2simg.c
-rwxrwxrwx 1 root root       5212 Sep 15 17:39 simg_dump.py

I also did more /proc/mounts and I got the following:-

    raunak@raunak-VirtualBox:/media/base$ more /proc/mounts

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

udev /dev devtmpfs rw,nosuid,relatime,size=310192k,nr_inodes=77548,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0

tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=65892k,mode=755 0 0

/dev/sda1 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0

securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0

tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0

tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0

tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0

cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,relea
se_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0

pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0

cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,ne
t_cls,net_prio 0 0

cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_eve
nt 0 0

cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0

cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0

cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpu
acct 0 0

cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0

cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0

cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0

cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0

cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0

systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=25,pgrp=1,timeout=0,min
proto=5,maxproto=5,direct 0 0

debugfs /sys/kernel/debug debugfs rw,relatime 0 0

mqueue /dev/mqueue mqueue rw,relatime 0 0

hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0

fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0

tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=65892k,mode=700,uid=100
0,gid=1000 0 0

gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=
1000,group_id=1000 0 0

/dev/sr0 /media/raunak/VBOXADDITIONS_5.1.6_110634 iso9660 ro,nosuid,nodev,relati
me,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500 0 0

/media/base /media/base vboxsf rw,nodev,relatime 0 0



    raunak@raunak-VirtualBox:/media/base$ file simg2img
simg2img: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, not stripped

2 Answers 2

3

Can a use a 32bit guest Ubuntu Virtual Machine on a 64bit host machine in a Virtual Box?

  • Yes.
  • The other way around also works but you then do need a 64-bit processor.
  • you can not execute a 32-bit file on a 64-bit system (or the other way around) without installing support for it. It is called multi-arch.

I am getting an error everytime which tells me no such file or directory found even when the binary file is in the same directory in which I am in

That, in general, means the file is not an executable.

  • check with ls -l what the settings are for that file.

So is it any problem with sharing of folders??

Executing from Microsoft filesystems is set when mounting the partition. So yes, this can be the cause.

  • check the mount options for the partition with more /proc/mounts.

If you need more information edit your question with at the least the results of above to checks to do so we can expand this Q+A.

15
  • I have done ls -l & more /proc/mounts. and I have posted it's output in the question.I have checked and the binary file is executable.I have also run the following commands sudo chmod +x simg2img. But I am still unable to execute the binary file.Everytime I am getting an error which says no such file or directory found whenever I am trying to execute the binary file and run this command sudo ./simg2img system.img sys.raw. Whenever I run this command I get an error saying no such file or directory found. Please help. Is there any way to run the binary file in my current VBox with Ubuntu 16.04 a
    – user598648
    Sep 24, 2016 at 17:22
  • can you do a file simg2img (check if it is a 32bit or 64bit program). I removed parts of the ls; all you needed to check was for that command ;)
    – Rinzwind
    Sep 24, 2016 at 18:09
  • Removed ls means?? Which command I needed to check??
    – user598648
    Sep 24, 2016 at 18:11
  • see my edit on your question ;-) same goes for proc/mount all we need is the one line those files are on :)
    – Rinzwind
    Sep 24, 2016 at 18:12
  • Oh u mean to say that we only need the 4 files that are still there on ur edited ls. and I a
    – user598648
    Sep 24, 2016 at 18:16
0

Yes, you can use a 32 bit guest OS in a 64 bit OS. But remember to use 64 bit guest OS in a 32 bit OS you'll need hardware that support 64 bit architecture. Also don't forget to change your virtualization BIOS setting to yes.

4
  • I have obtained the output of the ls -l and more /proc/mounts. and I have posted it in the question.
    – user598648
    Sep 24, 2016 at 17:02
  • I am still unable to run the command sudo ./simg2img system.img sys.raw
    – user598648
    Sep 24, 2016 at 17:03
  • I have also done this sudo chmod +x /simg2img but I am still unable to run the binary file.Please help.
    – user598648
    Sep 24, 2016 at 17:04
  • How do I change the virtualization BIOS setting to yes?
    – user598648
    Sep 24, 2016 at 17:23

You must log in to answer this question.

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