zhaodice / qemu-anti-detection

A patch to hide qemu itself, bypass mhyprot,EAC,nProtect / VMProtect,VProtect, Themida, Enigma Protector,Safegine Shielden
788 stars 117 forks source link

Help! #1

Open b1naryTR opened 2 years ago

b1naryTR commented 2 years ago

I have successfully compiled the thing, what do I do after compiling it? Please help. Thanks.

zhaodice commented 2 years ago

running sudo make install after your compiling will replace your official package "qemu-system-x86"

PS: if you want to undo it , you can reinstall "qemu-system-x86"

b1naryTR commented 2 years ago

After doing make install, I got "domain configration does not support video model 'xql'. When I tried to change it, I got "USB redirection is not supported by this version of QEMU." I tried both 6.2.0 and 7.0.0. Both are same, original version were working fine.

zhaodice commented 2 years ago

oh, you should add some features to support QXL and USB REDIRECTION Example: ../qemu/configure --target-list=x86_64-softmmu,x86_64-linux-user --enable-werror --enable-xen --enable-virtfs --enable-kvm --enable-libusb --enable-libudev --enable-spice --enable-usb-redir

This is my supports, if you are NO but I am YES, you should make it YES. more information see ../qemu/configure --help


qemu 7.0.0

  Directories
    Install prefix               : /usr
    BIOS directory               : share/qemu
    firmware path                : /usr/share/qemu-firmware
    binary directory             : bin
    library directory            : lib
    module directory             : lib/qemu
    libexec directory            : libexec
    include directory            : include
    config directory             : /usr/etc
    local state directory        : /usr/var
    Manual directory             : share/man
    Doc directory                : /usr/share/doc
    Build directory              : /home/user/data/git/qemu_build
    Source path                  : /home/user/data/git/qemu
    GIT submodules               : ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc capstone slirp

  Host binaries
    git                          : git
    make                         : make
    python                       : /usr/bin/python3 (version: 3.10)
    sphinx-build                 : NO
    gdb                          : /usr/bin/gdb
    iasl                         : iasl
    genisoimage                  : /usr/bin/genisoimage
    smbd                         : /usr/sbin/smbd

  Configurable features
    Documentation                : NO
    system-mode emulation        : YES
    user-mode emulation          : YES
    block layer                  : YES
    Install blobs                : YES
    module support               : NO
    fuzzing support              : NO
    Audio drivers                : pa oss
    Trace backends               : log
    D-Bus display                : NO
    QOM debugging                : NO
    vhost-kernel support         : YES
    vhost-net support            : YES
    vhost-crypto support         : YES
    vhost-scsi support           : YES
    vhost-vsock support          : YES
    vhost-user support           : YES
    vhost-user-blk server support: YES
    vhost-user-fs support        : YES
    vhost-vdpa support           : YES
    build guest agent            : YES

  Compilation
    host CPU                     : x86_64
    host endianness              : little
    C compiler                   : cc -m64 -mcx16
    Host C compiler              : cc -m64 -mcx16
    C++ compiler                 : c++ -m64 -mcx16
    CFLAGS                       : -O2 -g
    CXXFLAGS                     : -O2 -g
    QEMU_CFLAGS                  : -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong
    QEMU_CXXFLAGS                : -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong
    QEMU_OBJCFLAGS               : -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi
    QEMU_LDFLAGS                 : -Wl,--warn-common -Wl,-z,relro -Wl,-z,now  -fstack-protector-strong
    profiler                     : NO
    link-time optimization (LTO) : NO
    PIE                          : YES
    static build                 : NO
    malloc trim support          : YES
    membarrier                   : NO
    debug stack usage            : NO
    mutex debugging              : NO
    memory allocator             : system
    avx2 optimization            : YES
    avx512f optimization         : NO
    gprof enabled                : NO
    gcov                         : NO
    thread sanitizer             : NO
    CFI support                  : NO
    strip binaries               : NO
    sparse                       : NO
    mingw32 support              : NO
    x86_64 tests                 : cc

  Targets and accelerators
    KVM support                  : YES
    HAX support                  : NO
    HVF support                  : NO
    WHPX support                 : NO
    NVMM support                 : NO
    Xen support                  : YES
    xen ctrl version             : 41600
    TCG support                  : YES
    TCG backend                  : native (x86_64)
    TCG plugins                  : YES
    TCG debug enabled            : NO
    target list                  : x86_64-softmmu x86_64-linux-user
    default devices              : YES
    out of process emulation     : YES

  Block layer support
    coroutine backend            : ucontext
    coroutine pool               : YES
    Block whitelist (rw)         :
    Block whitelist (ro)         :
    Use block whitelist in tools : NO
    VirtFS support               : YES
    build virtiofs daemon        : YES
    Live block migration         : YES
    replication support          : YES
    bochs support                : YES
    cloop support                : YES
    dmg support                  : YES
    qcow v1 support              : YES
    vdi support                  : YES
    vvfat support                : YES
    qed support                  : YES
    parallels support            : YES
    FUSE exports                 : NO

  Crypto
    TLS priority                 : "NORMAL"
    GNUTLS support               : YES 3.7.3
      GNUTLS crypto              : YES
    libgcrypt                    : NO
    nettle                       : NO
    AF_ALG support               : NO
    rng-none                     : NO
    Linux keyring                : YES

  Dependencies
    SDL support                  : YES
    SDL image support            : YES 2.0.5
    GTK support                  : YES
    pixman                       : YES 0.40.0
    VTE support                  : YES 0.68.0
    slirp support                : internal
    libtasn1                     : YES 4.18.0
    PAM                          : YES
    iconv support                : YES
    curses support               : YES
    virgl support                : YES 0.9.1
    curl support                 : YES 7.81.0
    Multipath support            : NO
    VNC support                  : YES
    VNC SASL support             : YES
    VNC JPEG support             : YES 2.1.2
    VNC PNG support              : YES 1.6.37
    OSS support                  : YES
    ALSA support                 : YES 1.2.6.1
    PulseAudio support           : YES 15.99.1
    JACK support                 : NO
    brlapi support               : YES
    vde support                  : YES
    netmap support               : NO
    l2tpv3 support               : YES
    Linux AIO support            : YES
    Linux io_uring support       : NO
    ATTR/XATTR support           : YES
    RDMA support                 : NO
    PVRDMA support               : NO
    fdt support                  : system
    libcap-ng support            : YES
    bpf support                  : NO
    spice protocol support       : YES 0.14.3
      spice server support       : YES 0.15.0
    rbd support                  : YES
    smartcard support            : YES 2.8.0
    U2F support                  : NO
    libusb                       : YES 1.0.25
    usb net redir                : YES 0.11.0
    OpenGL support               : YES
    GBM                          : YES 22.0.5
    libiscsi support             : YES 1.19.0
    libnfs support               : YES 4.0.0
    seccomp support              : YES 2.5.3
    GlusterFS support            : NO
    TPM support                  : YES
    libssh support               : NO
    lzo support                  : YES
    snappy support               : YES
    bzip2 support                : YES
    lzfse support                : NO
    zstd support                 : YES 1.4.8
    NUMA host support            : YES
    capstone                     : internal
    libpmem support              : NO
    libdaxctl support            : NO
    libudev                      : YES 249
    FUSE lseek                   : NO
    selinux                      : YES 3.3

  Subprojects
    libvhost-user                : YES
zhaodice commented 2 years ago
Optional features, enabled with --enable-FEATURE and
disabled with --disable-FEATURE, default is enabled if available
(unless built with --without-default-features):

  alsa            ALSA sound support
  attr            attr/xattr support
  auth-pam        PAM access control
  avx2            AVX2 optimizations
  avx512f         AVX512F optimizations
  bochs           bochs image format support
  bpf             eBPF support
  brlapi          brlapi character device driver
  bzip2           bzip2 support for DMG images
  cap-ng          cap_ng support
  cloop           cloop image format support
  cocoa           Cocoa user interface (macOS only)
  coreaudio       CoreAudio sound support
  crypto-afalg    Linux AF_ALG crypto backend driver
  curl            CURL block device driver
  curses          curses UI
  dbus-display    -display dbus support
  dmg             dmg image format support
  docs            Documentations build support
  dsound          DirectSound sound support
  fuse            FUSE block device export
  fuse-lseek      SEEK_HOLE/SEEK_DATA support for FUSE exports
  gcrypt          libgcrypt cryptography support
  gettext         Localization of the GTK+ user interface
  glusterfs       Glusterfs block device driver
  gnutls          GNUTLS cryptography support
  gtk             GTK+ user interface
  guest-agent     Build QEMU Guest Agent
  guest-agent-msi Build MSI package for the QEMU Guest Agent
  hax             HAX acceleration support
  hvf             HVF acceleration support
  iconv           Font glyph conversion support
  jack            JACK sound support
  kvm             KVM acceleration support
  l2tpv3          l2tpv3 network backend support
  libdaxctl       libdaxctl support
  libiscsi        libiscsi userspace initiator
  libnfs          libnfs block device driver
  libpmem         libpmem support
  libssh          ssh block device support
  libudev         Use libudev to enumerate host devices
  libusb          libusb support for USB passthrough
  linux-aio       Linux AIO support
  linux-io-uring  Linux io_uring support
  live-block-migration
                  block migration in the main migration stream
  lzfse           lzfse support for DMG images
  lzo             lzo compression support
  malloc-trim     enable libc malloc_trim() for memory optimization
  membarrier      membarrier system call (for Linux 4.14+ or Windows
  mpath           Multipath persistent reservation passthrough
  multiprocess    Out of process device emulation support
  netmap          netmap network backend support
  nettle          nettle cryptography support
  numa            libnuma support
  nvmm            NVMM acceleration support
  oss             OSS sound support
  pa              PulseAudio sound support
  parallels       parallels image format support
  qcow1           qcow1 image format support
  qed             qed image format support
  qga-vss         build QGA VSS support (broken with MinGW)
  rbd             Ceph block device driver
  replication     replication support
  sdl             SDL user interface
  sdl-image       SDL Image support for icons
  seccomp         seccomp support
  selinux         SELinux support in qemu-nbd
  slirp-smbd      use smbd (at path --smbd=*) in slirp networking
  smartcard       CA smartcard emulation support
  snappy          snappy compression support
  sparse          sparse checker
  spice           Spice server support
  spice-protocol  Spice protocol support
  tcg             TCG support
  tools           build support utilities that come with QEMU
  tpm             TPM support
  u2f             U2F emulation support
  usb-redir       libusbredir support
  vde             vde network backend support
  vdi             vdi image format support
  vhost-user-blk-server
                  build vhost-user-blk server
  virglrenderer   virgl rendering support
  virtfs          virtio-9p support
  virtiofsd       build virtiofs daemon (virtiofsd)
  vnc             VNC server
  vnc-jpeg        JPEG lossy compression for VNC server
  vnc-png         PNG compression for VNC server
  vnc-sasl        SASL authentication for VNC server
  vte             vte support for the gtk UI
  vvfat           vvfat image format support
  whpx            WHPX acceleration support
  xen             Xen backend support
  xen-pci-passthrough
                  Xen PCI passthrough support
  xkbcommon       xkbcommon support
  zstd            zstd compression support
  system          all system emulation targets
  user            supported user emulation targets
  linux-user      all linux usermode emulation targets
  bsd-user        all BSD usermode emulation targets
  pie             Position Independent Executables
  modules         modules support (non-Windows)
  module-upgrades try to load modules from alternate paths for upgrades
  debug-tcg       TCG debugging (default is disabled)
  debug-info      debugging information
  lto             Enable Link-Time Optimization.
  safe-stack      SafeStack Stack Smash Protection. Depends on
                  clang/llvm >= 3.7 and requires coroutine backend ucontext.
  rdma            Enable RDMA-based migration
  pvrdma          Enable PVRDMA support
  vhost-net       vhost-net kernel acceleration support
  vhost-vsock     virtio sockets device support
  vhost-scsi      vhost-scsi kernel target support
  vhost-crypto    vhost-user-crypto backend support
  vhost-kernel    vhost kernel backend support
  vhost-user      vhost-user backend support
  vhost-vdpa      vhost-vdpa kernel backend support
  opengl          opengl support
  gio             libgio support
b1naryTR commented 2 years ago

is there any way to enable evertyhing or do I have to enter every parameter one by one?

zhaodice commented 2 years ago

is there any way to enable evertyhing or do I have to enter every parameter one by one?

it is unnecessary to enable everything , you can check your configure result which is NO but I am YES, find the "Optional features" , example you lack the "usb net redir" , the feature is "usb-redir" , so you should add "--enable-usb-redir"

actually, at least, I don't know how to enable all in one go

zhaodice commented 2 years ago

the interesting is if you installed dependents which the features needs, it is no longer have to add --enable-XXXX , the configure will enable every features which you has its dependents

b1naryTR commented 2 years ago

I got error "ERROR: Dependency "spice-server" not found, tried pkgconfig" when I tried your example command.

zhaodice commented 2 years ago

I got error "ERROR: Dependency "spice-server" not found, tried pkgconfig" when I tried your example command.

sudo apt install libspice-protocol-dev
sudo apt install libspice-server-dev
b1naryTR commented 2 years ago

Now I have "ERROR: Dependency "libusbredirparser-0.5" not found, tried pkgconfig". Is there any way to download all dependencies at once?

zhaodice commented 2 years ago

Now I have "ERROR: Dependency "libusbredirparser-0.5" not found, tried pkgconfig". Is there any way to download all dependencies at once?

apt install libusbredirparser-dev libusbredirparser1
b1naryTR commented 2 years ago

Oh I just solved it myself, installed package "libusbredirparser-dev"

b1naryTR commented 2 years ago

Btw I am trying to get valorant running on kvm, is there any crypology thingy I need to enable? Because my virtual TPM chip cannot prove file ownership.

b1naryTR commented 2 years ago

I just finished compiling, it still shows same error sadly.

zhaodice commented 2 years ago

Btw I am trying to get valorant running on kvm, is there any crypology thingy I need to enable? Because my virtual TPM chip cannot prove file ownership.

recently, I have tested the valorant on the vm(windows10 ) , Unfortunately my vm got blue screen(SYSTEM_THREAD_EXCEPTION_NOT_HANDLED) immediately when the valorant driver loaded, I don't know why...

zhaodice commented 2 years ago

I browsed the youtube, it said the valorant will cause blue screen in win10 , win7 will resolve it .. but my driver doesn't support win7,so I stopped my test.

zhaodice commented 2 years ago

hmmm,about TPM, you can passthough TPM to the vm, I guess it is helpful.

b1naryTR commented 2 years ago

I know about that, usb and xql are still fucked though

zhaodice commented 2 years ago

I know about that, usb and xql are still fucked though

you cannot use virtual graphic, please passthough GPU to vm... virtual graphic is easy to detect

b1naryTR commented 2 years ago

I have a laptop...

zhaodice commented 2 years ago

I have a laptop...

I have a notebook too, I have passthough the NVIDIA to the vm haha

b1naryTR commented 2 years ago

tf, how did you do that? When I tried it I could not bind pci devices

zhaodice commented 2 years ago

tf, how did you do that? When I tried it I could not bind pci devices

I followed this: https://lantian.pub/en/article/modify-computer/laptop-intel-nvidia-optimus-passthrough.lantian/

warning, something has changed since linux 5.19... I recommend linux 5.15

b1naryTR commented 2 years ago

I have "5.15.0-48-generic" as uname says. I guess it is ok?

Uname -a output: Linux TULPAR-T5-V19-2 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

zhaodice commented 2 years ago

I have "5.15.0-48-generic" as uname says. I guess it is ok?

Uname -a output: Linux TULPAR-T5-V19-2 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

It must be OK, because I am ubuntu 22.04 , linux 5.15 too

b1naryTR commented 2 years ago

I probably have MUXless laptop, because in windows when I disable iGPU, screen goes to 30hz instead of 144.

zhaodice commented 2 years ago

I probably have MUXless laptop, because in windows when I disable iGPU, screen goes to 30hz instead of 144.

I have passthough Intel(vgpu) and NVIDIA to the vm , so it is no problem

b1naryTR commented 2 years ago

Is there any way to install optimus-manager on ubuntu? There are only tutorials for arch. But there was something-switch included inside nvidia drivers.

zhaodice commented 2 years ago

Is there any way to install optimus-manager on ubuntu? There are only tutorials for arch. But there was something-switch included inside nvidia drivers.

I didn't install nvidia driver to my computer, nvidia driver serves vm only

zhaodice commented 2 years ago

Screenshot_20221004_021656 this is my passthough result

b1naryTR commented 2 years ago

So, do I need to uninstall my drivers?

b1naryTR commented 2 years ago

Oh and usb thingy still isn't working

zhaodice commented 2 years ago

Oh and usb thingy still isn't working

usb redirect is not essential, you can remove it from your vm. your nvidia device must be handled by driver vfio-pci detail: https://lantian.pub/en/article/modify-computer/laptop-intel-nvidia-optimus-passthrough.lantian/

zhaodice commented 2 years ago

So, do I need to uninstall my drivers?

if you needn't it on your host machine, you can uninstall it… at least, I have no any nvidia driver in my host computer, only vm has it.

b1naryTR commented 2 years ago

I am going to lose my mind, on build spice protocol and server support are marked yes but I can't fucking use spice. And xml editor on virt-manager doesn't work!!! When I enable xml editing on preferences it DOESN'T FUCKING WORK

b1naryTR commented 2 years ago

When I tried to remove usb redirectors it asks me to save the changes but I FUCKING CHANGED GPU SETTINGS and it doesn't apply either of them, just throws an error.

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

b1naryTR commented 2 years ago

I tried to create new machine but I can't. Because fuck me.

Unable to complete install: 'internal error: cannot update AppArmor profile 'libvirt-865576b2-ee2f-46e9-8b6e-9a79bcc35c38''

zhaodice commented 2 years ago

Unable to complete install: 'internal error: cannot update AppArmor profile 'libvirt-865576b2-ee2f-46e9-8b6e-9a79bcc35c38''

https://stackoverflow.com/questions/34001337/libvirt-error-when-trying-to-hot-attach-disk-on-guest-with-channel-qemu-ga it maybe caused by your xml which has some problem

b1naryTR commented 2 years ago

Looks like it's an XML problem but not sure how to fix it. I must say that it was working fine without patch and modified build. In my case, problem doesn't seem to do anything about disk. I get same error without disk.

Here is the log:

Unable to complete install: 'internal error: cannot update AppArmor profile 'libvirt-62565ea6-8ade-4039-a816-91da6d9f5e91''

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 695, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 637, in _create_guest
    domain = self.conn.createXML(initial_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4400, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: cannot update AppArmor profile 'libvirt-62565ea6-8ade-4039-a816-91da6d9f5e91'

Should I try to create machines on arch? I am currentry using Ubuntu.

zhaodice commented 2 years ago

try to run ../qemu/configure and paste the result

nhamhuynh79 commented 1 year ago

Screenshot_20221004_021656 this is my passthough result

Hello, How connect to virt-manager? I have this error : error: Failed to define domain from win10.xml error: internal error: Failed to start QEMU binary /usr/local/bin/qemu-system-x86_64 for probing: libvirt: error : cannot execute binary /usr/local/bin/qemu-system-x86_64: Permission denied

zhaodice commented 1 year ago

/usr/local/bin/qemu-system-x86_64

chmod +x /usr/local/bin/qemu-system-x86_64