doomedraven / Tools

Combination of different utilities, have fun!
MIT License
202 stars 96 forks source link

Error during qemu installation #65

Closed ClaudioWayne closed 3 years ago

ClaudioWayne commented 3 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

run kvm-qemu.sh qemu without error

Current Behavior

Hi Doomedraven,

On a Fresh Ubuntu 20.04.1 i get the following Errors:

Error 1:

[+] Patching QEMU clues
[+] Starting compile it
Using './build' as the directory for build output

ERROR: Cannot find Ninja

[-] Compilling failed

Seems that qemu 5.2.0 needs ninja? What worked for me -> pip3 install ninja

Error 2:

E: Unable to locate package qemu-5.2.0-1_amd64.deb

What worked for me Escape _ between qemu-version Complete Path to qemu-5.2.0_5.2.0-1_amd64.deb apt -y -o Dpkg::Options::="--force-overwrite" install /tmp/qemu-$qemu_version/qemu-$qemu_version\_$qemu_version-1_amd64.deb

See changes here: https://github.com/ClaudioWayne/Tools/commits/master

Have you tried to update qemu 5.1.0 to 5.2.0 and and libvirt 6.2.0 libvirt 6.10.0 via ./kvm-qemu.sh without breaking CAPE? Or do you recommend a fresh CAPE and KVM/QEMU installation?

Steps to Reproduce

sudo ./kvm-qemu.sh qemu

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Question Answer
OS version Ubuntu 20.04.1
doomedraven commented 3 years ago

hello @ClaudioWayne , i have updated it on my personal server without any problem, but i had problems to compile and install as it was overwriting so i forced that apt by hand, and about ninja i had it as libvirt 6.7 I think changed building to ninja. i will need to restore my testing vm and check the script again.

so after your fixes it works or not? just to know? i wil lcopy and but not sure if i will have time as i have one neat feature to test for cape and that will require days for a lot of rewrite and testing

ClaudioWayne commented 3 years ago

Installing cape on a fresh Ubuntu with the changes in kvm-qemu.sh right now. It will take a while. i will let you know if it was successful.

doomedraven commented 3 years ago

thank you, and thanks for all the updates and fixes

ClaudioWayne commented 3 years ago

I just tested a sample on the complete fresh install in a win7 VM. Everything works fine.

FYI: During the installation i collected these Pip Errors

ERROR: requests 2.25.0 has requirement chardet<4,>=3.0.2, but you'll have chardet 4.0.0 which is incompatible.
ERROR: peepdf 0.4.2 has requirement Pillow==3.2.0, but you'll have pillow 7.0.0 which is incompatible.
ERROR: log-symbols 0.0.14 has requirement colorama>=0.3.9, but you'll have colorama 0.3.7 which is incompatible.
ERROR: halo 0.0.31 has requirement colorama>=0.3.9, but you'll have colorama 0.3.7 which is incompatible.
ERROR: pyattck 2.1.3 has requirement Pillow>=6.2.2, but you'll have pillow 3.2.0 which is incompatible.
ERROR: matplotlib 3.3.3 has requirement pillow>=6.2.0, but you'll have pillow 3.2.0 which is incompatible.
ERROR: peepdf 0.4.2 has requirement Pillow==3.2.0, but you'll have pillow 8.0.1 which is incompatible.

At the End of complete installation these packages are installed atm:

pip3 freeze

alabaster==0.7.12
alembic==1.0.11
altgraph==0.17
androguard==3.3.5
aniso8601==8.1.0
apparmor==2.13.3
appdirs==1.4.4
apturl==0.5.2
asgiref==3.3.1
asn1crypto==1.4.0
attrs==20.3.0
Babel==2.9.0
backcall==0.2.0
beautifulsoup4==4.8.2
blinker==1.4
bottle==0.12.19
Brlapi==0.7.0
bs4==0.0.1
bson==0.5.10
capstone==4.0.2
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==6.6
colorama==0.3.7
colorclass==2.2.0
command-not-found==0.3
construct==2.9.45
cryptography==3.3.1
cupshelpers==1.0
cybox==2.1.0.21
cycler==0.10.0
Cython==0.29.21
dbus-python==1.2.16
decorator==4.4.2
defer==1.0.6
Deprecated==1.2.10
distorm3==3.5.1
distro==1.4.0
distro-info===0.23ubuntu1
Django==3.1.4
django-ratelimit==3.0.1
dnspython==1.16.0
docutils==0.16
dpkt==1.9.4
easygui==0.98.1
entrypoints==0.3
et-xmlfile==1.0.1
filelock==3.0.12
fire==0.3.1
flake8==3.8.4
flare-capa==1.4.0
Flask==1.1.2
Flask-RESTful==0.3.8
Flask-SQLAlchemy==2.4.4
Flor==1.1.3
future==0.18.2
GeoIP==1.3.2
geoip2==2.9.0
gevent==20.4.0
gpg===1.13.1-unknown
greenlet==0.4.16
halo==0.0.31
html5lib==1.0.1
httplib2==0.14.0
ida-netnode==3.0
ida-settings==2.1.0
idna==2.10
ImageHash==4.2.0
imagesize==1.2.0
ipaddr==2.2.0
ipaddress==1.0.23
ipython==7.19.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
java-random==1.0
javaobj-py3==0.4.1
jdcal==1.4.1
jedi==0.17.2
Jinja2==2.11.2
jsbeautifier==1.6.2
jsonschema==3.2.0
keyring==18.0.1
kiwisolver==1.3.1
language-selector==0.1
lark-parser==0.11.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
LibAppArmor==2.13.3
libvirt-python==6.10.0
lief==0.10.1
linecache2==1.0.0
log-symbols==0.0.14
louis==3.12.0
lxml==4.6.2
macaroonbakery==1.3.1
maec==4.1.0.17
Mako==1.1.0
malwareconfig==1.0.4
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.3.3
maxminddb==2.0.3
mccabe==0.6.1
meson==0.56.0
mixbox==1.0.5
msoffcrypto-tool==4.11.0
mwcp==3.2.1
netifaces==0.10.4
networkx==2.5
ninja==1.10.0.post2
nose==1.3.7
ntlm-auth==1.1.0
numpy==1.19.4
oauthlib==3.1.0
olefile==0.46
oletools==0.56
openpyxl==3.0.5
ordered-set==4.0.2
packaging==20.8
parso==0.7.1
passlib==1.7.4
pbkdf2==1.3
pbr==5.4.5
pcodedmp==1.2.6
Pebble==4.5.3
peepdf==0.4.2
pefile==2019.4.18
pendulum==1.2.5
pexpect==4.6.0
pickleshare==0.7.5
Pillow==8.0.1
prompt-toolkit==3.0.8
protobuf==3.6.1
psycopg2==2.8.6
pyattck==2.1.3
pycairo==1.20.0
pycodestyle==2.6.0
pycparser==2.20
pycrypto==2.6.1
pycryptodomex==3.9.9
pycups==1.9.73
pydeep==0.4
pydot==1.4.1
pyelftools==0.26
pyfiglet==0.8.post1
pyflakes==2.2.0
pygal==2.4.0
Pygments==2.2.0
PyGObject==3.38.0
pyinstaller==4.1
pyinstaller-hooks-contrib==2020.10
PyJWT==1.7.1
pymacaroons==0.13.0
pymisp==2.4.135.3
pymongo==3.11.2
PyNaCl==1.3.0
pyOpenSSL==20.0.1
pyparsing==2.3.0
pype32-py3==0.1
pyre2==0.3.1
pyRFC3339==1.1
pyrsistent==0.17.3
PySocks==1.7.1
python-apt==2.0.0+ubuntu0.20.4.2
python-dateutil==2.8.1
python-debian===0.1.36ubuntu1
python-editor==1.0.4
python-magic==0.4.18
python-whois==0.7.3
pythonaes==1.0
pytz==2019.3
pytzdata==2020.1
pyvmomi==7.0.1
PyWavelets==1.1.1
pyxdg==0.26
pyxlsb2==0.0.2
PyYAML==5.3.1
pyzipper==0.3.3
rarfile==4.0
regex==2020.11.13
reportlab==3.5.34
requests==2.25.0
requests-file==1.5.1
requests-unixsocket==0.2.0
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
scipy==1.5.4
SecretStorage==2.3.1
SFlock==0.3.10
simplejson==3.17.2
six==1.15.0
smda==1.5.10
snowballstemmer==2.0.0
Socks5man==0.3.0
soupsieve==1.9.5
Sphinx==3.3.1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
spinners==0.0.24
SQLAlchemy==1.3.20
SQLAlchemy-Utils==0.36.8
sqlparse==0.4.1
statistics==1.0.3.5
suricata-update==1.1.0
systemd-python==234
tabulate==0.8.7
termcolor==1.1.0
testresources==2.0.0
tldextract==3.1.0
tqdm==4.54.1
traceback2==1.4.0
traitlets==5.0.5
tzlocal==2.1
ubuntu-advantage-tools==20.3
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
unicorn==1.0.2
unittest2==1.1.0
untangle==1.1.1
urllib3==1.26.2
volatility==2.0.0b1
voluptuous==0.12.1
wadllib==1.3.3
wcwidth==0.2.5
weakrefmethod==1.0.3
webencodings==0.5.1
Werkzeug==1.0.1
wrapt==1.12.1
xkit==0.0.0
XLMMacroDeobfuscator==0.1.6
xlrd2==1.2.6
xmltodict==0.12.0
yara-python==4.0.2

So requests, pyattck, matplotlib should be fine log-symbols, halo 0.0.31 -> "colorama>=0.3.9" for peepdf no idea

But i guess these errors are not critical.

BTW: Do you recommend Pillow 8.0.1 in the Guest-Machine to match with host?

Feel free to close this issue and have nice day. Thank you for keeping this project alive.

doomedraven commented 3 years ago

by parts the latest pillow always better, we saw huge performance difference between old and new versions about pip erros ya many libs trying to enforce the dependence but that is impossible, so that not critical so far

if i tell you truth i don't even know which lib needs log-symbols

thank you for headups

ClaudioWayne commented 3 years ago

okay, thanks for information

doomedraven commented 3 years ago

so i suppouse we can close the issue?

ClaudioWayne commented 3 years ago

yep

ClaudioWayne commented 3 years ago

Hi, one more question: did you notice some permission changes in libvirt version >6.7.0? Every time i submit an analysis and when processing starts, the password prompt appears. It also appears when i start virtmanager. With 6.7.0 its fine. I tried usermod -a -G kvm <username>, usermod -a -G libvirt<username> chgrp kvm /dev/kvm added rule etc/udev/rules.d/50-qemu-kvm.rules KERNEL=="kvm", GROUP="kvm", MODE="0660" added rule /lib/udev/rules.d/65-kvm.rules KERNEL=="kvm", GROUP="kvm", MODE="0660" /etc/apparmor.d/usr.sbin.libvirtd and /usr/sbin/libvirtd set AppArmor security profile to complain mode

but it could be an individual problem of mine

doomedraven commented 3 years ago

Hello, well i heard from one friend about it, but wasn't able to reproduce, normally ensure this,

sed -i 's/#unix_sock_group/unix_sock_group/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#unix_sock_ro_perms = "0777"/unix_sock_ro_perms = "0770"/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#unix_sock_rw_perms = "0770"/unix_sock_rw_perms = "0770"/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#auth_unix_ro = "none"/auth_unix_ro = "none"/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#auth_unix_rw = "none"/auth_unix_rw = "none"/g' /etc/libvirt/libvirtd.conf
ClaudioWayne commented 3 years ago

thanks, i will try this. Have a nice weekend

doomedraven commented 3 years ago

thank you, you too, let me know if that doesn't work, I maybe can help to investigate, if you can capture the whole permission error that would help

doomedraven commented 3 years ago

hey i just found why it happens, will push that to repo too in few mins, they changed from none to polkit string

sed -i 's/#auth_unix_ro = "polkit"/auth_unix_ro = "none"/g' "/etc/libvirt/libvirtd.conf"
sed -i 's/#auth_unix_rw = "polkit"/auth_unix_rw = "none"/g' "/etc/libvirt/libvirtd.conf"
ClaudioWayne commented 3 years ago

oh sorry didn´t see your comment. i just pushed a PR. u can ignore it :D

doomedraven commented 3 years ago

glad that you also found that :) yes i prefer keep it working for both versions as there is no problem as strings between versions changes, so i will close it, but thank you for taking it and helping

casrar commented 1 year ago

I had the ERROR: Cannot find Ninja as well, I resolved by downloading on my system with pacman -S ninja. I also have an issue with sphinx but I assume that would be a similar resolution.

doomedraven commented 1 year ago

Maybe, im not suporting anything else that is not ubuntu 22.04

El jue, 28 sept 2023, 20:44, Casey @.***> escribió:

I had the ERROR: Cannot find Ninja as well, I resolved by downloading on my system with pacman -S ninja. I also have an issue with sphinx but I assume that would be a similar resolution.

— Reply to this email directly, view it on GitHub https://github.com/doomedraven/Tools/issues/65#issuecomment-1739835776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOFH37U34G5DOCWWEQVUCLX4XAPXANCNFSM4U53AJDA . You are receiving this because you commented.Message ID: @.***>

casrar commented 1 year ago

Maybe, im not suporting anything else that is not ubuntu 22.04 El jue, 28 sept 2023, 20:44, Casey @.> escribió: I had the ERROR: Cannot find Ninja as well, I resolved by downloading on my system with pacman -S ninja. I also have an issue with sphinx but I assume that would be a similar resolution. — Reply to this email directly, view it on GitHub <#65 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOFH37U34G5DOCWWEQVUCLX4XAPXANCNFSM4U53AJDA . You are receiving this because you commented.Message ID: @.>

Sorry! Yea I was just having this issue with QEMU itself not specifically your project. Should have mentioned that, my bad.

doomedraven commented 1 year ago

that fine, i understood. I hope you was able to fix your issues and got it working