danielpoliakov / lisa

Sandbox for automated Linux malware analysis.
Apache License 2.0
475 stars 91 forks source link

qemu-system-x86_64: not found #1

Closed xkill closed 4 years ago

xkill commented 5 years ago

Hi,

The new version of Debian requires qemu-system-x86 package to provide the binary: qemu-system-x86_64

I got the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pexpect/spawnbase.py", line 150, in read_nonblocking
    s = os.read(self.child_fd, size)
OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pexpect/expect.py", line 99, in expect_loop
    incoming = spawn.read_nonblocking(spawn.maxread, timeout)
  File "/usr/local/lib/python3.6/site-packages/pexpect/pty_spawn.py", line 465, in read_nonblocking
    return super(spawn, self).read_nonblocking(size)
  File "/usr/local/lib/python3.6/site-packages/pexpect/spawnbase.py", line 155, in read_nonblocking
    raise EOF('End Of File (EOF). Exception style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 648, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/lisa/lisa/web_api/tasks.py", line 80, in full_analysis
    master.run()
  File "/home/lisa/lisa/analysis/top_level.py", line 69, in run
    sub_output = analyzer.run_analysis()
  File "/home/lisa/lisa/analysis/dynamic_analysis.py", line 36, in run_analysis
    self._vm.start_vm()
  File "/home/lisa/lisa/core/qemu_guest.py", line 100, in start_vm
    self._proc.expect('login: ')
  File "/usr/local/lib/python3.6/site-packages/pexpect/spawnbase.py", line 321, in expect
    timeout, searchwindowsize, async)
  File "/usr/local/lib/python3.6/site-packages/pexpect/spawnbase.py", line 345, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/local/lib/python3.6/site-packages/pexpect/expect.py", line 105, in expect_loop
    return self.eof(e)
  File "/usr/local/lib/python3.6/site-packages/pexpect/expect.py", line 50, in eof
    raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7f28b30ade48>
command: /home/lisa/images/x86_64/run.sh
args: [b'/home/lisa/images/x86_64/run.sh', b'/home/lisa/data/storage/7cee9747-25ad-4dfa-a59b-83ef8190bd5b/rootfs']
buffer (last 100 chars): ''
before (last 100 chars): '/home/lisa/images/x86_64/run.sh: 8: /home/lisa/images/x86_64/run.sh: qemu-system-x86_64: not found\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 127
flag_eof: True
pid: 29
child_fd: 13
closed: False
timeout: 70
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: <_io.TextIOWrapper name='/home/lisa/data/storage/7cee9747-25ad-4dfa-a59b-83ef8190bd5b/machine.log' mode='w' encoding='utf-8'>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile("login: ")
danielpoliakov commented 5 years ago

Hello,

qemu package installed in current Dockerfiles is a metapackage that should install all qemu related stuff (incl. qemu-system-x86). I tried to do clean rebuild (as mentioned in README), but I can't reproduce the error you mentioned.

But - it is probably good idea to remove qemu metapackage (the description of new debian versions of qemu metapackage says that we should rather use individual qemu-system-* packages - like qemu-system-x86 you added in your pull request).

Would you rather consider (and test if everything works that way on your side) to change your pull request that the Dockerfile installs qemu-system metapackage that installs qemu-system-* for all architectures (or as for now supported architectures by LiSa - packages qemu-system-x86, qemu-system-arm, qemu-system-mips)?

danielpoliakov commented 4 years ago

Solved by #4