QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 8.0

Yet another update to this QEMU series after the versions 2.0.0QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 2.0.0 and version 6.2QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 6.2.0

main menu
hot add CPU

The latest version of QEMU is 8.0.4 and it offers way more CPU flags and features! You can use QEMU with nearly native full virtualization. Here are some important tips for the guest CPU to consider when using QEMU directly (without any virtualization manager like virt-manager, libvirt and so on).

TIP 1) CPU emulation of x86

You can see what options are available for host emulation with:

root@srv ~ # qemu-system-x86_64 -cpu help
Available CPUs:
x86 486                   (alias configured by machine type)
x86 486-v1                
x86 Broadwell             (alias configured by machine type)
x86 Broadwell-IBRS        (alias of Broadwell-v3)
x86 Broadwell-noTSX       (alias of Broadwell-v2)
x86 Broadwell-noTSX-IBRS  (alias of Broadwell-v4)
x86 Broadwell-v1          Intel Core Processor (Broadwell)
x86 Broadwell-v2          Intel Core Processor (Broadwell, no TSX)
x86 Broadwell-v3          Intel Core Processor (Broadwell, IBRS)
x86 Broadwell-v4          Intel Core Processor (Broadwell, no TSX, IBRS)
x86 Cascadelake-Server    (alias configured by machine type)
x86 Cascadelake-Server-noTSX  (alias of Cascadelake-Server-v3)
x86 Cascadelake-Server-v1  Intel Xeon Processor (Cascadelake)
x86 Cascadelake-Server-v2  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES]
x86 Cascadelake-Server-v3  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES, no TSX]
x86 Cascadelake-Server-v4  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES, no TSX]
x86 Cascadelake-Server-v5  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES, EPT switching, XSAVES, no TSX]
x86 Conroe                (alias configured by machine type)
x86 Conroe-v1             Intel Celeron_4x0 (Conroe/Merom Class Core 2)
x86 Cooperlake            (alias configured by machine type)
x86 Cooperlake-v1         Intel Xeon Processor (Cooperlake)
x86 Cooperlake-v2         Intel Xeon Processor (Cooperlake) [XSAVES]
x86 Denverton             (alias configured by machine type)
x86 Denverton-v1          Intel Atom Processor (Denverton)
x86 Denverton-v2          Intel Atom Processor (Denverton) [no MPX, no MONITOR]
x86 Denverton-v3          Intel Atom Processor (Denverton) [XSAVES, no MPX, no MONITOR]
x86 Dhyana                (alias configured by machine type)
x86 Dhyana-v1             Hygon Dhyana Processor
x86 Dhyana-v2             Hygon Dhyana Processor [XSAVES]
x86 EPYC                  (alias configured by machine type)
x86 EPYC-IBPB             (alias of EPYC-v2)
x86 EPYC-Milan            (alias configured by machine type)
x86 EPYC-Milan-v1         AMD EPYC-Milan Processor
x86 EPYC-Rome             (alias configured by machine type)
x86 EPYC-Rome-v1          AMD EPYC-Rome Processor
x86 EPYC-Rome-v2          AMD EPYC-Rome Processor
x86 EPYC-v1               AMD EPYC Processor
x86 EPYC-v2               AMD EPYC Processor (with IBPB)
x86 EPYC-v3               AMD EPYC Processor
x86 Haswell               (alias configured by machine type)
x86 Haswell-IBRS          (alias of Haswell-v3)
x86 Haswell-noTSX         (alias of Haswell-v2)
x86 Haswell-noTSX-IBRS    (alias of Haswell-v4)
x86 Haswell-v1            Intel Core Processor (Haswell)
x86 Haswell-v2            Intel Core Processor (Haswell, no TSX)
x86 Haswell-v3            Intel Core Processor (Haswell, IBRS)
x86 Haswell-v4            Intel Core Processor (Haswell, no TSX, IBRS)
x86 Icelake-Server        (alias configured by machine type)
x86 Icelake-Server-noTSX  (alias of Icelake-Server-v2)
x86 Icelake-Server-v1     Intel Xeon Processor (Icelake)
x86 Icelake-Server-v2     Intel Xeon Processor (Icelake) [no TSX]
x86 Icelake-Server-v3     Intel Xeon Processor (Icelake)
x86 Icelake-Server-v4     Intel Xeon Processor (Icelake)
x86 Icelake-Server-v5     Intel Xeon Processor (Icelake) [XSAVES]
x86 Icelake-Server-v6     Intel Xeon Processor (Icelake) [5-level EPT]
x86 IvyBridge             (alias configured by machine type)
x86 IvyBridge-IBRS        (alias of IvyBridge-v2)
x86 IvyBridge-v1          Intel Xeon E3-12xx v2 (Ivy Bridge)
x86 IvyBridge-v2          Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)
x86 KnightsMill           (alias configured by machine type)
x86 KnightsMill-v1        Intel Xeon Phi Processor (Knights Mill)
x86 Nehalem               (alias configured by machine type)
x86 Nehalem-IBRS          (alias of Nehalem-v2)
x86 Nehalem-v1            Intel Core i7 9xx (Nehalem Class Core i7)
x86 Nehalem-v2            Intel Core i7 9xx (Nehalem Core i7, IBRS update)
x86 Opteron_G1            (alias configured by machine type)
x86 Opteron_G1-v1         AMD Opteron 240 (Gen 1 Class Opteron)
x86 Opteron_G2            (alias configured by machine type)
x86 Opteron_G2-v1         AMD Opteron 22xx (Gen 2 Class Opteron)
x86 Opteron_G3            (alias configured by machine type)
x86 Opteron_G3-v1         AMD Opteron 23xx (Gen 3 Class Opteron)
x86 Opteron_G4            (alias configured by machine type)
x86 Opteron_G4-v1         AMD Opteron 62xx class CPU
x86 Opteron_G5            (alias configured by machine type)
x86 Opteron_G5-v1         AMD Opteron 63xx class CPU
x86 Penryn                (alias configured by machine type)
x86 Penryn-v1             Intel Core 2 Duo P9xxx (Penryn Class Core 2)
x86 SandyBridge           (alias configured by machine type)
x86 SandyBridge-IBRS      (alias of SandyBridge-v2)
x86 SandyBridge-v1        Intel Xeon E312xx (Sandy Bridge)
x86 SandyBridge-v2        Intel Xeon E312xx (Sandy Bridge, IBRS update)
x86 SapphireRapids        (alias configured by machine type)
x86 SapphireRapids-v1     Intel Xeon Processor (SapphireRapids)
x86 Skylake-Client        (alias configured by machine type)
x86 Skylake-Client-IBRS   (alias of Skylake-Client-v2)
x86 Skylake-Client-noTSX-IBRS  (alias of Skylake-Client-v3)
x86 Skylake-Client-v1     Intel Core Processor (Skylake)
x86 Skylake-Client-v2     Intel Core Processor (Skylake, IBRS)
x86 Skylake-Client-v3     Intel Core Processor (Skylake, IBRS, no TSX)
x86 Skylake-Client-v4     Intel Core Processor (Skylake, IBRS, no TSX) [IBRS, XSAVES, no TSX]
x86 Skylake-Server        (alias configured by machine type)
x86 Skylake-Server-IBRS   (alias of Skylake-Server-v2)
x86 Skylake-Server-noTSX-IBRS  (alias of Skylake-Server-v3)
x86 Skylake-Server-v1     Intel Xeon Processor (Skylake)
x86 Skylake-Server-v2     Intel Xeon Processor (Skylake, IBRS)
x86 Skylake-Server-v3     Intel Xeon Processor (Skylake, IBRS, no TSX)
x86 Skylake-Server-v4     Intel Xeon Processor (Skylake, IBRS, no TSX)
x86 Skylake-Server-v5     Intel Xeon Processor (Skylake, IBRS, no TSX) [IBRS, XSAVES, EPT switching, no TSX]
x86 Snowridge             (alias configured by machine type)
x86 Snowridge-v1          Intel Atom Processor (SnowRidge)
x86 Snowridge-v2          Intel Atom Processor (Snowridge, no MPX)
x86 Snowridge-v3          Intel Atom Processor (Snowridge, no MPX) [XSAVES, no MPX]
x86 Snowridge-v4          Intel Atom Processor (Snowridge, no MPX) [no split lock detect, no core-capability]
x86 Westmere              (alias configured by machine type)
x86 Westmere-IBRS         (alias of Westmere-v2)
x86 Westmere-v1           Westmere E56xx/L56xx/X56xx (Nehalem-C)
x86 Westmere-v2           Westmere E56xx/L56xx/X56xx (IBRS update)
x86 athlon                (alias configured by machine type)
x86 athlon-v1             QEMU Virtual CPU version 2.5+
x86 core2duo              (alias configured by machine type)
x86 core2duo-v1           Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
x86 coreduo               (alias configured by machine type)
x86 coreduo-v1            Genuine Intel(R) CPU           T2600  @ 2.16GHz
x86 kvm32                 (alias configured by machine type)
x86 kvm32-v1              Common 32-bit KVM processor
x86 kvm64                 (alias configured by machine type)
x86 kvm64-v1              Common KVM processor
x86 n270                  (alias configured by machine type)
x86 n270-v1               Intel(R) Atom(TM) CPU N270   @ 1.60GHz
x86 pentium               (alias configured by machine type)
x86 pentium-v1            
x86 pentium2              (alias configured by machine type)
x86 pentium2-v1           
x86 pentium3              (alias configured by machine type)
x86 pentium3-v1           
x86 phenom                (alias configured by machine type)
x86 phenom-v1             AMD Phenom(tm) 9550 Quad-Core Processor
x86 qemu32                (alias configured by machine type)
x86 qemu32-v1             QEMU Virtual CPU version 2.5+
x86 qemu64                (alias configured by machine type)
x86 qemu64-v1             QEMU Virtual CPU version 2.5+
x86 base                  base CPU model type with no features enabled
x86 host                  processor with all supported host features 
x86 max                   Enables all features supported by the accelerator in the current host

Recognized CPUID flags:
  3dnow 3dnowext 3dnowprefetch abm ace2 ace2-en acpi adx aes amd-no-ssb
  amd-ssbd amd-stibp amx-bf16 amx-int8 amx-tile apic arat arch-capabilities
  arch-lbr avic avx avx-vnni avx2 avx512-4fmaps avx512-4vnniw avx512-bf16
  avx512-fp16 avx512-vp2intersect avx512-vpopcntdq avx512bitalg avx512bw
  avx512cd avx512dq avx512er avx512f avx512ifma avx512pf avx512vbmi
  avx512vbmi2 avx512vl avx512vnni bmi1 bmi2 bus-lock-detect cid cldemote
  clflush clflushopt clwb clzero cmov cmp-legacy core-capability cr8legacy
  cx16 cx8 dca de decodeassists ds ds-cpl dtes64 erms est extapic f16c
  flushbyasid fma fma4 fpu fsgsbase fsrc fsrm fsrs full-width-write fxsr
  fxsr-opt fzrm gfni hle ht hypervisor ia64 ibpb ibrs ibrs-all ibs intel-pt
  intel-pt-lip invpcid invtsc kvm-asyncpf kvm-asyncpf-int
  kvm-hint-dedicated kvm-mmu kvm-msi-ext-dest-id kvm-nopiodelay
  kvm-poll-control kvm-pv-eoi kvm-pv-ipi kvm-pv-sched-yield
  kvm-pv-tlb-flush kvm-pv-unhalt kvm-steal-time kvmclock kvmclock
  kvmclock-stable-bit la57 lahf-lm lbrv lm lwp mca mce md-clear mds-no
  misalignsse mmx mmxext monitor movbe movdir64b movdiri mpx msr mtrr
  nodeid-msr npt nrip-save nx osvw pae pat pause-filter pbe pcid pclmulqdq
  pcommit pdcm pdpe1gb perfctr-core perfctr-nb pfthreshold pge phe phe-en
  pks pku pmm pmm-en pn pni popcnt pschange-mc-no pse pse36 rdctl-no rdpid
  rdrand rdseed rdtscp rsba rtm sep serialize sgx sgx-aex-notify sgx-debug
  sgx-edeccssa sgx-exinfo sgx-kss sgx-mode64 sgx-provisionkey sgx-tokenkey
  sgx1 sgx2 sgxlc sha-ni skinit skip-l1dfl-vmentry smap smep smx spec-ctrl
  split-lock-detect ss ssb-no ssbd sse sse2 sse4.1 sse4.2 sse4a ssse3 stibp
  svm svm-lock svme-addr-chk syscall taa-no tbm tce tm tm2 topoext tsc
  tsc-adjust tsc-deadline tsc-scale tsx-ctrl tsx-ldtrk umip v-vmsave-vmload
  vaes vgif virt-ssbd vmcb-clean vme vmx vmx-activity-hlt
  vmx-activity-shutdown vmx-activity-wait-sipi vmx-apicv-register
  vmx-apicv-vid vmx-apicv-x2apic vmx-apicv-xapic vmx-cr3-load-noexit
  vmx-cr3-store-noexit vmx-cr8-load-exit vmx-cr8-store-exit vmx-desc-exit
  vmx-encls-exit vmx-entry-ia32e-mode vmx-entry-load-bndcfgs
  vmx-entry-load-efer vmx-entry-load-pat vmx-entry-load-perf-global-ctrl
  vmx-entry-load-pkrs vmx-entry-load-rtit-ctl vmx-entry-noload-debugctl
  vmx-ept vmx-ept-1gb vmx-ept-2mb vmx-ept-advanced-exitinfo
  vmx-ept-execonly vmx-eptad vmx-eptp-switching vmx-exit-ack-intr
  vmx-exit-clear-bndcfgs vmx-exit-clear-rtit-ctl vmx-exit-load-efer
  vmx-exit-load-pat vmx-exit-load-perf-global-ctrl vmx-exit-load-pkrs
  vmx-exit-nosave-debugctl vmx-exit-save-efer vmx-exit-save-pat
  vmx-exit-save-preemption-timer vmx-flexpriority vmx-hlt-exit vmx-ins-outs
  vmx-intr-exit vmx-invept vmx-invept-all-context vmx-invept-single-context
  vmx-invept-single-context vmx-invept-single-context-noglobals
  vmx-invlpg-exit vmx-invpcid-exit vmx-invvpid vmx-invvpid-all-context
  vmx-invvpid-single-addr vmx-io-bitmap vmx-io-exit vmx-monitor-exit
  vmx-movdr-exit vmx-msr-bitmap vmx-mtf vmx-mwait-exit vmx-nmi-exit
  vmx-page-walk-4 vmx-page-walk-5 vmx-pause-exit vmx-ple vmx-pml
  vmx-posted-intr vmx-preemption-timer vmx-rdpmc-exit vmx-rdrand-exit
  vmx-rdseed-exit vmx-rdtsc-exit vmx-rdtscp-exit vmx-secondary-ctls
  vmx-shadow-vmcs vmx-store-lma vmx-true-ctls vmx-tsc-offset
  vmx-tsc-scaling vmx-unrestricted-guest vmx-vintr-pending vmx-vmfunc
  vmx-vmwrite-vmexit-fields vmx-vnmi vmx-vnmi-pending vmx-vpid
  vmx-wbinvd-exit vmx-xsaves vmx-zero-len-inject vpclmulqdq waitpkg
  wbnoinvd wdt x2apic xcrypt xcrypt-en xfd xgetbv1 xop xsave xsavec
  xsaveerptr xsaveopt xsaves xstore xstore-en xtpr

Keep on reading!

Minimal network installation of Fedora 37 Server

This tutorial will show you the simple steps of installing a modern Linux Distribution Fedora 37 Server edition. Fedora line offers many bleeding-edge Linux technologies than the more enterprise CentOS of the same RPM Linux family.

In fact, if the user needs a server with the latest Linux stable software Fedora server is the right and easy choice for a server!

Here are some basic data from the default installation setup settings:

  1. Installed packages – ~678 occupying 1.7G of space.
  2. 3 partitions when using automatic partition layout – boot efi, boot and root.
  3. xfs used for the root partition.

The Fedora 37 Server comes and updates to the latest stable Linux:

  • Linux kernel : 6.0.11.
  • Python : 3.11
  • GLibc : 2.36
  • OpenSSL : 3.0.5
  • systemd : 251.8

More detailed software overview here – Software and technical details of Fedora Server 37 including cockpit screenshots.

Of course, one can expect the latest version of GCC (12.2.1), PHP (8.1.13), GO (1.19.3), MySQL Server (8.0.31), PostgreSQL (14.3), Nginx (1.22.1), Apache (2.4.54) and so on. Almost all of them are the latest stable version on their Internet sites.
Just be careful, the Fedora life cycle is 13 months from the release to the EOL (End of Life)! Of course, a dist-upgrade is supported and indeed, it has been flawless for years!

We used the following ISO for the installation process from https://getfedora.org/en/server/download/:

https://download.fedoraproject.org/pub/fedora/linux/releases/37/Server/x86_64/iso/Fedora-Server-netinst-x86_64-37-1.7.iso

It is a LIVE image so you can try it before installing it. The easiest way is to download the image and burn it to a DVD or USB stick disk and then follow the installation below (a USB flash drive could be also created from this ISO). The netinstall installation is as simple as having a good Internet connection to download the packages, the installation wizard automatically detects the closest mirror, from which it will download the packages. Essentially, the network does not differ from the ordinary installation except it expects to download the packages from the Internet.

SCREENSHOT 1) If you booted from the DVD/USB you would get this first screen – select “Install Fedora 37” and hit Enter

main menu
Install Fedora 37 grub entry

Keep on reading!

How to run QEMU full virtualization with MacVTap networking using NetworkManager under CentOS 8

In addition to the previously presented article on the subject Howto do QEMU full virtualization with MacVTap networking this one shows how to run a QEMU virtual machine with a MAcVTap device in bridge mode on the host server configured only by using the NetworkManager cli – nmcli.

It is worth mentioning the MacVTap is a virtual bridge, which will make the host and the guest device show up directly on the host switch. So when using QEMU, the guest virtualized system will be as if it is connected to the host switch with one limitation – the host and guest cannot communicate with each other. The IPs of the host won’t be reachable from the guest, so NAT (masquerade) between the host and guest is not possible with this setup. Still, if the NAT server is on another server or a real IP is planned for the guest, MacVTap is the right functionality to use with the QEMU guest system.

Summary

  1. Add MacVTap device in bridge mode with name macvtap0.
  2. Install QEMU.
  3. Create QEMU local disk.
  4. Run a QEMU virtual server.

STEP 1) Add MacVTap device in bridge mode with name macvtap0

[root@srv ~]# nmcli connection add type macvlan dev enp0s3 mode bridge tap yes ifname macvtap0 con-name macvtap0 ip4 0.0.0.0/24
Connection 'macvtap0' (7a5ef04c-ea98-4642-ac5d-4239f715f631) successfully added.
[root@srv ~]# nmcli con
NAME      UUID                                  TYPE      DEVICE   
enp0s3    09497bbf-da59-42b7-a72c-d69369760b36  ethernet  enp0s3   
macvtap0  7a5ef04c-ea98-4642-ac5d-4239f715f631  macvlan   macvtap0 

First, create a MacVTap device with the name macvtap0 in bridge mode with the network interface enp0s3 a and a connection with the name macvtap0. The IP is set to manual mode.
More detailed information on how to create and add MacVTap device with the NetworkManager here – Create MacVTap device using NetworkManager nmcli under CentOS 8

STEP 2) Install QEMU.

Install the QEMU virtual tools under CentOS 8 Stream. At present, the QEMU version is 6.2, which is pretty new.
Keep on reading!

QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 6.2.0

This article is an updated version of the old QEMU article about CPU flags available for version 2.0.0QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 2.0.0.
The latest version of QEMU is 6.2.0 and it offers way more CPU flags and features! You can use QEMU with a nearly native full virtualization. Here are some important tips for the guest CPU to consider when using QEMU directly (without any virtualization manager like virt-manager, libvirt and so on).

TIP 1)Choose your host CPU emulation

You can see what options are available for host emulation with:

root@srv ~ # qemu-system-x86_64 -cpu help
Available CPUs:
x86 486                   (alias configured by machine type)                        
x86 486-v1                                                                          
x86 Broadwell             (alias configured by machine type)                        
x86 Broadwell-IBRS        (alias of Broadwell-v3)                                   
x86 Broadwell-noTSX       (alias of Broadwell-v2)                                   
x86 Broadwell-noTSX-IBRS  (alias of Broadwell-v4)                                   
x86 Broadwell-v1          Intel Core Processor (Broadwell)                          
x86 Broadwell-v2          Intel Core Processor (Broadwell, no TSX)                  
x86 Broadwell-v3          Intel Core Processor (Broadwell, IBRS)                    
x86 Broadwell-v4          Intel Core Processor (Broadwell, no TSX, IBRS)            
x86 Cascadelake-Server    (alias configured by machine type)                        
x86 Cascadelake-Server-noTSX  (alias of Cascadelake-Server-v3)                          
x86 Cascadelake-Server-v1  Intel Xeon Processor (Cascadelake)                        
x86 Cascadelake-Server-v2  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES]    
x86 Cascadelake-Server-v3  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES, no TSX]
x86 Cascadelake-Server-v4  Intel Xeon Processor (Cascadelake) [ARCH_CAPABILITIES, no TSX]
x86 Conroe                (alias configured by machine type)                        
x86 Conroe-v1             Intel Celeron_4x0 (Conroe/Merom Class Core 2)             
x86 Cooperlake            (alias configured by machine type)                        
x86 Cooperlake-v1         Intel Xeon Processor (Cooperlake)                         
x86 Denverton             (alias configured by machine type)                        
x86 Denverton-v1          Intel Atom Processor (Denverton)                          
x86 Denverton-v2          Intel Atom Processor (Denverton) [no MPX, no MONITOR]     
x86 Dhyana                (alias configured by machine type)                        
x86 Dhyana-v1             Hygon Dhyana Processor                                    
x86 EPYC                  (alias configured by machine type)                        
x86 EPYC-IBPB             (alias of EPYC-v2)                                        
x86 EPYC-Milan            (alias configured by machine type)                        
x86 EPYC-Milan-v1         AMD EPYC-Milan Processor                                  
x86 EPYC-Rome             (alias configured by machine type)                        
x86 EPYC-Rome-v1          AMD EPYC-Rome Processor                                   
x86 EPYC-Rome-v2          AMD EPYC-Rome Processor                                   
x86 EPYC-v1               AMD EPYC Processor                                        
x86 EPYC-v2               AMD EPYC Processor (with IBPB)                            
x86 EPYC-v3               AMD EPYC Processor                                        
x86 Haswell               (alias configured by machine type)                        
x86 Haswell-IBRS          (alias of Haswell-v3)                                     
x86 Haswell-noTSX         (alias of Haswell-v2)                                     
x86 Haswell-noTSX-IBRS    (alias of Haswell-v4)                                     
x86 Haswell-v1            Intel Core Processor (Haswell)                            
x86 Haswell-v2            Intel Core Processor (Haswell, no TSX)                    
x86 Haswell-v3            Intel Core Processor (Haswell, IBRS)                      
x86 Haswell-v4            Intel Core Processor (Haswell, no TSX, IBRS)              
x86 Icelake-Client        (alias configured by machine type)                        
x86 Icelake-Client-noTSX  (alias of Icelake-Client-v2)                              
x86 Icelake-Client-v1     Intel Core Processor (Icelake) [deprecated]               
x86 Icelake-Client-v2     Intel Core Processor (Icelake) [no TSX, deprecated]       
x86 Icelake-Server        (alias configured by machine type)                        
x86 Icelake-Server-noTSX  (alias of Icelake-Server-v2)                              
x86 Icelake-Server-v1     Intel Xeon Processor (Icelake)                            
x86 Icelake-Server-v2     Intel Xeon Processor (Icelake) [no TSX]                   
x86 Icelake-Server-v3     Intel Xeon Processor (Icelake)                            
x86 Icelake-Server-v4     Intel Xeon Processor (Icelake)                            
x86 IvyBridge             (alias configured by machine type)                        
x86 IvyBridge-IBRS        (alias of IvyBridge-v2)                                   
x86 IvyBridge-v1          Intel Xeon E3-12xx v2 (Ivy Bridge)                        
x86 IvyBridge-v2          Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)                  
x86 KnightsMill           (alias configured by machine type)                        
x86 KnightsMill-v1        Intel Xeon Phi Processor (Knights Mill)                   
x86 Nehalem               (alias configured by machine type)                        
x86 Nehalem-IBRS          (alias of Nehalem-v2)                                     
x86 Nehalem-v1            Intel Core i7 9xx (Nehalem Class Core i7)                 
x86 Nehalem-v2            Intel Core i7 9xx (Nehalem Core i7, IBRS update)          
x86 Opteron_G1            (alias configured by machine type)                        
x86 Opteron_G1-v1         AMD Opteron 240 (Gen 1 Class Opteron)                     
x86 Opteron_G2            (alias configured by machine type)                        
x86 Opteron_G2-v1         AMD Opteron 22xx (Gen 2 Class Opteron)                    
x86 Opteron_G3            (alias configured by machine type)                        
x86 Opteron_G3-v1         AMD Opteron 23xx (Gen 3 Class Opteron)                    
x86 Opteron_G4            (alias configured by machine type)                        
x86 Opteron_G4-v1         AMD Opteron 62xx class CPU                                
x86 Opteron_G5            (alias configured by machine type)                        
x86 Opteron_G5-v1         AMD Opteron 63xx class CPU                                
x86 Penryn                (alias configured by machine type)                        
x86 Penryn-v1             Intel Core 2 Duo P9xxx (Penryn Class Core 2)              
x86 SandyBridge           (alias configured by machine type)                        
x86 SandyBridge-IBRS      (alias of SandyBridge-v2)                                 
x86 SandyBridge-v1        Intel Xeon E312xx (Sandy Bridge)                          
x86 SandyBridge-v2        Intel Xeon E312xx (Sandy Bridge, IBRS update)             
x86 Skylake-Client        (alias configured by machine type)                        
x86 Skylake-Client-IBRS   (alias of Skylake-Client-v2)                              
x86 Skylake-Client-noTSX-IBRS  (alias of Skylake-Client-v3)                              
x86 Skylake-Client-v1     Intel Core Processor (Skylake)                            
x86 Skylake-Client-v2     Intel Core Processor (Skylake, IBRS)                      
x86 Skylake-Client-v3     Intel Core Processor (Skylake, IBRS, no TSX)              
x86 Skylake-Server        (alias configured by machine type)                        
x86 Skylake-Server-IBRS   (alias of Skylake-Server-v2)                              
x86 Skylake-Server-noTSX-IBRS  (alias of Skylake-Server-v3)                              
x86 Skylake-Server-v1     Intel Xeon Processor (Skylake)                            
x86 Skylake-Server-v2     Intel Xeon Processor (Skylake, IBRS)                      
x86 Skylake-Server-v3     Intel Xeon Processor (Skylake, IBRS, no TSX)              
x86 Skylake-Server-v4     Intel Xeon Processor (Skylake, IBRS, no TSX)              
x86 Snowridge             (alias configured by machine type)                        
x86 Snowridge-v1          Intel Atom Processor (SnowRidge)                          
x86 Snowridge-v2          Intel Atom Processor (Snowridge, no MPX)                  
x86 Westmere              (alias configured by machine type)                        
x86 Westmere-IBRS         (alias of Westmere-v2)                                    
x86 Westmere-v1           Westmere E56xx/L56xx/X56xx (Nehalem-C)                    
x86 Westmere-v2           Westmere E56xx/L56xx/X56xx (IBRS update)                  
x86 athlon                (alias configured by machine type)                        
x86 athlon-v1             QEMU Virtual CPU version 2.5+                             
x86 core2duo              (alias configured by machine type)                        
x86 core2duo-v1           Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz           
x86 coreduo               (alias configured by machine type)                        
x86 coreduo-v1            Genuine Intel(R) CPU           T2600  @ 2.16GHz           
x86 kvm32                 (alias configured by machine type)                        
x86 kvm32-v1              Common 32-bit KVM processor                               
x86 kvm64                 (alias configured by machine type)                        
x86 kvm64-v1              Common KVM processor                                      
x86 n270                  (alias configured by machine type)                        
x86 n270-v1               Intel(R) Atom(TM) CPU N270   @ 1.60GHz                    
x86 pentium               (alias configured by machine type)                        
x86 pentium-v1                                                                      
x86 pentium2              (alias configured by machine type)                        
x86 pentium2-v1                                                                     
x86 pentium3              (alias configured by machine type)                        
x86 pentium3-v1                                                                     
x86 phenom                (alias configured by machine type)                        
x86 phenom-v1             AMD Phenom(tm) 9550 Quad-Core Processor                   
x86 qemu32                (alias configured by machine type)                        
x86 qemu32-v1             QEMU Virtual CPU version 2.5+                             
x86 qemu64                (alias configured by machine type)                        
x86 qemu64-v1             QEMU Virtual CPU version 2.5+                             
x86 base                  base CPU model type with no features enabled              
x86 host                  KVM processor with all supported host features            
x86 max                   Enables all features supported by the accelerator in the current host

Recognized CPUID flags:
  3dnow 3dnowext 3dnowprefetch abm ace2 ace2-en acpi adx aes amd-no-ssb
  amd-ssbd amd-stibp apic arat arch-capabilities avic avx avx2
  avx512-4fmaps avx512-4vnniw avx512-bf16 avx512-fp16 avx512-vp2intersect
  avx512-vpopcntdq avx512bitalg avx512bw avx512cd avx512dq avx512er avx512f
  avx512ifma avx512pf avx512vbmi avx512vbmi2 avx512vl avx512vnni bmi1 bmi2
  bus-lock-detect cid cldemote clflush clflushopt clwb clzero cmov
  cmp-legacy core-capability cr8legacy cx16 cx8 dca de decodeassists ds
  ds-cpl dtes64 erms est extapic f16c flushbyasid fma fma4 fpu fsgsbase
  fsrm full-width-write fxsr fxsr-opt gfni hle ht hypervisor ia64 ibpb ibrs
  ibrs-all ibs intel-pt intel-pt-lip invpcid invtsc kvm-asyncpf
  kvm-asyncpf-int kvm-hint-dedicated kvm-mmu kvm-msi-ext-dest-id
  kvm-nopiodelay kvm-poll-control kvm-pv-eoi kvm-pv-ipi kvm-pv-sched-yield
  kvm-pv-tlb-flush kvm-pv-unhalt kvm-steal-time kvmclock kvmclock
  kvmclock-stable-bit la57 lahf-lm lbrv lm lwp mca mce md-clear mds-no
  misalignsse mmx mmxext monitor movbe movdir64b movdiri mpx msr mtrr
  nodeid-msr npt nrip-save nx osvw pae pat pause-filter pbe pcid pclmulqdq
  pcommit pdcm pdpe1gb perfctr-core perfctr-nb pfthreshold pge phe phe-en
  pks pku pmm pmm-en pn pni popcnt pschange-mc-no pse pse36 rdctl-no rdpid
  rdrand rdseed rdtscp rsba rtm sep serialize sha-ni skinit
  skip-l1dfl-vmentry smap smep smx spec-ctrl split-lock-detect ss ssb-no
  ssbd sse sse2 sse4.1 sse4.2 sse4a ssse3 stibp svm svm-lock svme-addr-chk
  syscall taa-no tbm tce tm tm2 topoext tsc tsc-adjust tsc-deadline
  tsc-scale tsx-ctrl tsx-ldtrk umip v-vmsave-vmload vaes vgif virt-ssbd
  vmcb-clean vme vmx vmx-activity-hlt vmx-activity-shutdown
  vmx-activity-wait-sipi vmx-apicv-register vmx-apicv-vid vmx-apicv-x2apic
  vmx-apicv-xapic vmx-cr3-load-noexit vmx-cr3-store-noexit
  vmx-cr8-load-exit vmx-cr8-store-exit vmx-desc-exit vmx-encls-exit
  vmx-entry-ia32e-mode vmx-entry-load-bndcfgs vmx-entry-load-efer
  vmx-entry-load-pat vmx-entry-load-perf-global-ctrl vmx-entry-load-pkrs
  vmx-entry-load-rtit-ctl vmx-entry-noload-debugctl vmx-ept vmx-ept-1gb
  vmx-ept-2mb vmx-ept-advanced-exitinfo vmx-ept-execonly vmx-eptad
  vmx-eptp-switching vmx-exit-ack-intr vmx-exit-clear-bndcfgs
  vmx-exit-clear-rtit-ctl vmx-exit-load-efer vmx-exit-load-pat
  vmx-exit-load-perf-global-ctrl vmx-exit-load-pkrs
  vmx-exit-nosave-debugctl vmx-exit-save-efer vmx-exit-save-pat
  vmx-exit-save-preemption-timer vmx-flexpriority vmx-hlt-exit vmx-ins-outs
  vmx-intr-exit vmx-invept vmx-invept-all-context vmx-invept-single-context
  vmx-invept-single-context vmx-invept-single-context-noglobals
  vmx-invlpg-exit vmx-invpcid-exit vmx-invvpid vmx-invvpid-all-context
  vmx-invvpid-single-addr vmx-io-bitmap vmx-io-exit vmx-monitor-exit
  vmx-movdr-exit vmx-msr-bitmap vmx-mtf vmx-mwait-exit vmx-nmi-exit
  vmx-page-walk-4 vmx-page-walk-5 vmx-pause-exit vmx-ple vmx-pml
  vmx-posted-intr vmx-preemption-timer vmx-rdpmc-exit vmx-rdrand-exit
  vmx-rdseed-exit vmx-rdtsc-exit vmx-rdtscp-exit vmx-secondary-ctls
  vmx-shadow-vmcs vmx-store-lma vmx-true-ctls vmx-tsc-offset
  vmx-unrestricted-guest vmx-vintr-pending vmx-vmfunc
  vmx-vmwrite-vmexit-fields vmx-vnmi vmx-vnmi-pending vmx-vpid
  vmx-wbinvd-exit vmx-xsaves vmx-zero-len-inject vpclmulqdq waitpkg
  wbnoinvd wdt x2apic xcrypt xcrypt-en xgetbv1 xop xsave xsavec xsaveerptr
  xsaveopt xsaves xstore xstore-en xtpr

The number of supported flags grew enormously compared to the old versions of QEMU and in fact, they include almost all available CPU flags. The supported CPUs are also several times more than before! The above list of supported CPUs means the virtual guest machine could use one of them and the guest operating system will have all the flags the CPU supports. In fact, the guest virtual system will report to the OS it has the selected CPU from the list above.
Keep on reading!

syslog – UDP local to syslog-ng and send remote. Forward syslog to remote server.

After writing an article for the rsyslog daemon about forwarding local UDP logging to a remote server using TCP – UDP local to rsyslog and send remote with TCP and compression this time going to use syslog-ng daemon for those who use it as default in their Linux distribution.
As mentioned in the previous article always use a non-blocking way of writing logs using UDP locally and then transfer (forward) the logs to the centralized log server(s). The example here transfers the web server’s access logs to a remote server. The web server is an Nginx web server.
The goal is to use

  • UDP for the client program (Nginx in the case) for non-blocking log writes.
  • TCP between our local machine and the remote syslog server – to be sure not to lose messages on bad connectivity.
  • local caching for our client machine – not to lose messages if the remote syslog is temporary unreachable.

The configuration and the commands are tested on CentOS 7, CentOS 8, Gentoo and Ubuntu 18 LTS. Check out UDP remote logging here – nginx remote logging to UDP rsyslog server (CentOS 7) to see how to build the server-side part – the syslog server accepting the syslog messages and writing them into files.

STEP 1) Listen for local UDP connections

Configuration file /etc/syslog-ng/syslog-ng.conf

source udp_local {
    network(ip(127.0.0.1) port(514) transport("udp") so_rcvbuf(67108864) log_fetch_limit(1000) max-connections(1000) log-iw-size(1000000));
};

Keep on reading!

Install xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS

This is simple “how to” to get started mining crypto currency with XMR-STAK using cryptonight algorithm like monero, electroneum, intensecoin and more. This time we are going to use PPA repository for the NVIDIA drivers and the CUDA toolkit. Installing the official NVIDIA driver we can use our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition to mine along with our processor AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz).
XMR-STAK could be used only for CPU mining, but now we installed an NVIDIA card and Ubuntu 18.04 LTS. Ubuntu is installed with the default open source NVIDIA driver (nouveau), which is OK for every day and office use, but if you like to game or to mine you must install the proprietary driver shipped by NVIDIA. The following howto will show you how to do it!

Just follow the simple steps and you’ll have an optimized GPU and CPU miner for cryptonight crypto currencies:

STEP 1) Install Ubuntu 18.04 LTS.

If you do not have Ubuntu installed yet it is time to do it. You can see how easy is to do it here even if you have multiple systems installed – Install Ubuntu Desktop 18.04 LTS on a PC with existing windows 10 and linux If your machine is only for mining and you want to have only one system it’s even simpler and you can still follow the above howto!

STEP 2) Install NVIDIA proprietary driver and CUDA Toolkit

Here we show you a brief command set to execute, but if you want a detailed explanations you could check the two howtos on the subject: Install NVIDIA proprietary drivers on Ubuntu 18.0 LTS (x86_64) and Install NVIDIA Cuda on Ubuntu 18.04 LTS (x86_64)

myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo add-apt-repository -y ppa:graphics-drivers/ppa
myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo ubuntu-drivers autoinstall
myuser@srv:~$ sudo reboot
myuser@srv:~$ sudo apt install -y nvidia-cuda-toolkit gcc-6

Check if your driver is loaded successfully before continuing:

myuser@srv:~$ dmesg|grep -i nvidia
[    1.414268] nvidia: loading out-of-tree module taints kernel.
[    1.414273] nvidia: module license 'NVIDIA' taints kernel.
[    1.632334] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.639698] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[    1.640031] nvidia 0000:0a:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    1.640146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  396.24.10  Tue Jul 10 10:00:18 PDT 2018 (using threaded interrupts)
[    1.647029] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  396.24.10  Tue Jul 10 08:53:56 PDT 2018
[    1.648372] [drm] [nvidia-drm] [GPU ID 0x00000a00] Loading driver
[    1.648373] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:0a:00.0 on minor 0
[   37.086767] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 511
[   37.761570] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   38.532918] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[   38.532960] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   38.532996] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input18
[   38.533028] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input19
[   40.851562] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   41.205592] nvidia-modeset: Allocated GPU:0 (GPU-3bad60bf-8ff7-4cba-8b51-a931299a56d8) @ PCI:0000:0a:00.0

STEP 3) Install dependencies for XMR-STAK

Around 380Mbytes of libraries and tools to be installed in addition.

myuser@srv:~$ sudo apt -y install libboost-all-dev libleveldb-dev libcurl4-openssl-dev libmicrohttpd-dev libminiupnpc-dev libgmp-dev libmicrohttpd-dev libssl-dev cmake build-essential screen git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
The following additional packages will be installed:
  autotools-dev cmake-data dh-python gir1.2-harfbuzz-0.0 ibverbs-providers icu-devtools libboost-atomic-dev libboost-atomic1.65-dev libboost-atomic1.65.1
  libboost-chrono-dev libboost-chrono1.65-dev libboost-chrono1.65.1 libboost-container-dev libboost-container1.65-dev libboost-container1.65.1 libboost-context-dev
  libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev libboost-coroutine1.65-dev libboost-coroutine1.65.1 libboost-date-time-dev
  libboost-date-time1.65-dev libboost-dev libboost-exception-dev libboost-exception1.65-dev libboost-fiber-dev libboost-fiber1.65-dev libboost-fiber1.65.1
  libboost-filesystem-dev libboost-filesystem1.65-dev libboost-graph-dev libboost-graph-parallel-dev libboost-graph-parallel1.65-dev libboost-graph-parallel1.65.1
  libboost-graph1.65-dev libboost-graph1.65.1 libboost-iostreams-dev libboost-iostreams1.65-dev libboost-locale-dev libboost-locale1.65-dev libboost-log-dev
  libboost-log1.65-dev libboost-log1.65.1 libboost-math-dev libboost-math1.65-dev libboost-math1.65.1 libboost-mpi-dev libboost-mpi-python-dev libboost-mpi-python1.65-dev
  libboost-mpi-python1.65.1 libboost-mpi1.65-dev libboost-mpi1.65.1 libboost-numpy-dev libboost-numpy1.65-dev libboost-numpy1.65.1 libboost-program-options-dev
  libboost-program-options1.65-dev libboost-program-options1.65.1 libboost-python-dev libboost-python1.65-dev libboost-python1.65.1 libboost-random-dev
  libboost-random1.65-dev libboost-random1.65.1 libboost-regex-dev libboost-regex1.65-dev libboost-regex1.65.1 libboost-serialization-dev libboost-serialization1.65-dev
  libboost-serialization1.65.1 libboost-signals-dev libboost-signals1.65-dev libboost-signals1.65.1 libboost-stacktrace-dev libboost-stacktrace1.65-dev
  libboost-stacktrace1.65.1 libboost-system-dev libboost-system1.65-dev libboost-test-dev libboost-test1.65-dev libboost-test1.65.1 libboost-thread-dev
  libboost-thread1.65-dev libboost-timer-dev libboost-timer1.65-dev libboost-timer1.65.1 libboost-tools-dev libboost-type-erasure-dev libboost-type-erasure1.65-dev
  libboost-type-erasure1.65.1 libboost-wave-dev libboost-wave1.65-dev libboost-wave1.65.1 libboost1.65-dev libboost1.65-tools-dev libcurl4 libexpat1-dev libfabric1
  libgcrypt20-dev libglib2.0-dev libglib2.0-dev-bin libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libgraphite2-dev
  libharfbuzz-dev libharfbuzz-gobject0 libhwloc-dev libhwloc-plugins libhwloc5 libibverbs-dev libibverbs1 libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60
  libidn2-0-dev libidn2-dev libjsoncpp1 libleveldb1v5 libltdl-dev libmicrohttpd12 libnl-route-3-200 libnuma-dev libopenmpi-dev libopenmpi2 libp11-kit-dev libpcre16-3
  libpcre3-dev libpcre32-3 libpcrecpp0v5 libpsm-infinipath1 libpython-dev libpython-stdlib libpython2.7-dev libpython3-dev libpython3.6-dev librdmacm1 librhash0
  libsnappy1v5 libssl-doc libtasn1-6-dev libtasn1-doc libtool libunbound2 libuv1 mpi-default-bin mpi-default-dev nettle-dev openmpi-bin openmpi-common python python-dev
  python-minimal python2.7 python2.7-dev python2.7-minimal python3-dev python3-distutils python3-lib2to3 python3.6-dev zlib1g-dev git-man liberror-perl libutempter0
Suggested packages:
  cmake-doc ninja-build libboost-doc graphviz libboost1.65-doc gccxml libmpfrc++-dev libntl-dev xsltproc doxygen docbook-xml docbook-xsl default-jdk fop libcurl4-doc
  libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev libgcrypt20-doc libglib2.0-doc gmp-doc libgmp10-doc libmpfr-dev gnutls-doc gnutls-bin libgraphite2-utils
  libhwloc-contrib-plugins icu-doc leveldb-doc libtool-doc minissdpd openmpi-doc autoconf automaken gfortran | fortran95-compiler gcj-jdk gfortran python-doc python-tk git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn byobu | screenie | iselect
  python2.7-doc binfmt-support
The following NEW packages will be installed:
  autotools-dev cmake cmake-data dh-python gir1.2-harfbuzz-0.0 ibverbs-providers icu-devtools libboost-all-dev libboost-atomic-dev libboost-atomic1.65-dev
  libboost-atomic1.65.1 libboost-chrono-dev libboost-chrono1.65-dev libboost-chrono1.65.1 libboost-container-dev libboost-container1.65-dev libboost-container1.65.1
  libboost-context-dev libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev libboost-coroutine1.65-dev libboost-coroutine1.65.1 libboost-date-time-dev
  libboost-date-time1.65-dev libboost-dev libboost-exception-dev libboost-exception1.65-dev libboost-fiber-dev libboost-fiber1.65-dev libboost-fiber1.65.1
  libboost-filesystem-dev libboost-filesystem1.65-dev libboost-graph-dev libboost-graph-parallel-dev libboost-graph-parallel1.65-dev libboost-graph-parallel1.65.1
  libboost-graph1.65-dev libboost-graph1.65.1 libboost-iostreams-dev libboost-iostreams1.65-dev libboost-locale-dev libboost-locale1.65-dev libboost-log-dev
  libboost-log1.65-dev libboost-log1.65.1 libboost-math-dev libboost-math1.65-dev libboost-math1.65.1 libboost-mpi-dev libboost-mpi-python-dev libboost-mpi-python1.65-dev
  libboost-mpi-python1.65.1 libboost-mpi1.65-dev libboost-mpi1.65.1 libboost-numpy-dev libboost-numpy1.65-dev libboost-numpy1.65.1 libboost-program-options-dev
  libboost-program-options1.65-dev libboost-program-options1.65.1 libboost-python-dev libboost-python1.65-dev libboost-python1.65.1 libboost-random-dev
  libboost-random1.65-dev libboost-random1.65.1 libboost-regex-dev libboost-regex1.65-dev libboost-regex1.65.1 libboost-serialization-dev libboost-serialization1.65-dev
  libboost-serialization1.65.1 libboost-signals-dev libboost-signals1.65-dev libboost-signals1.65.1 libboost-stacktrace-dev libboost-stacktrace1.65-dev
  libboost-stacktrace1.65.1 libboost-system-dev libboost-system1.65-dev libboost-test-dev libboost-test1.65-dev libboost-test1.65.1 libboost-thread-dev
  libboost-thread1.65-dev libboost-timer-dev libboost-timer1.65-dev libboost-timer1.65.1 libboost-tools-dev libboost-type-erasure-dev libboost-type-erasure1.65-dev
  libboost-type-erasure1.65.1 libboost-wave-dev libboost-wave1.65-dev libboost-wave1.65.1 libboost1.65-dev libboost1.65-tools-dev libcurl4 libcurl4-openssl-dev
  libexpat1-dev libfabric1 libgcrypt20-dev libglib2.0-dev libglib2.0-dev-bin libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28
  libgpg-error-dev libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libhwloc-dev libhwloc-plugins libhwloc5 libibverbs-dev libibverbs1 libicu-dev libicu-le-hb-dev
  libicu-le-hb0 libiculx60 libidn2-0-dev libidn2-dev libjsoncpp1 libleveldb-dev libleveldb1v5 libltdl-dev libmicrohttpd-dev libmicrohttpd12 libminiupnpc-dev
  libnl-route-3-200 libnuma-dev libopenmpi-dev libopenmpi2 libp11-kit-dev libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpsm-infinipath1 libpython-dev
  libpython-stdlib libpython2.7-dev libpython3-dev libpython3.6-dev librdmacm1 librhash0 libsnappy1v5 libssl-dev libssl-doc libtasn1-6-dev libtasn1-doc libtool
  libunbound2 libuv1 mpi-default-bin mpi-default-dev nettle-dev openmpi-bin openmpi-common python python-dev python-minimal python2.7 python2.7-dev python2.7-minimal
  python3-dev python3-distutils python3-lib2to3 python3.6-dev zlib1g-dev git git-man liberror-perl libutempter0 screen
0 upgraded, 179 newly installed, 0 to remove and 26 not upgraded.
Need to get 76.9 MB of archives.
After this operation, 380 MB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 python2.7-minimal amd64 2.7.15~rc1-1 [1292 kB]
....
....

Tune the screen program (this is not mandatory, but is important to have good scrolling) and start screen.

myuser@srv:~$ echo "termcapinfo xterm* ti@:te@" >> ~/.screenrc
myuser@srv:~$ screen -R xmr-stak

STEP 4) Compile XMR-STAK

First get the sources from the official github repository. The master is now with tag 2.4.7. If you do not know how to work with git and want the exact tag version it is easy, just open in the browser “https://github.com/fireice-uk/xmr-stak” change “Branch:master” (click on it and a dropdown will appear, click the tab “Tag” and select your tag version) to “Tag:2.4.7” then click on “Clone or download” on the right and click on “Download ZIP” and it will offer you to download a zip file with the name 2.4.7.zip (here is the URL: https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7).
This step it is important to note that we MUST build XMR-STAK with GNU GCC 6 (6.4.0) and the default GNU GCC in Ubuntu 18.04 LTS is 7 (7.3.0), so we export environment variables “CC” and “CXX” to use gcc-6. Exporting CC and CXX is enough to compile succeessfully no need to mess with “update-alternatives”.

myuser@srv:~$ git clone https://github.com/fireice-uk/xmr-stak
Cloning into 'xmr-stak'...
remote: Counting objects: 5078, done.
remote: Total 5078 (delta 0), reused 0 (delta 0), pack-reused 5078
Receiving objects: 100% (5078/5078), 1.48 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (3628/3628), done.
myuser@srv:~$ #or just download the tag version 2.4.7 from this url: https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7 or as it was described above. This 3 lines are comments, if you want tag 2.4.7 just uncomment the second and the third lines
myuser@srv:~$ #wget https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7
myuser@srv:~$ #unzip 2.4.7.zip
myuser@srv:~$ mkdir -p ./xmr-stak/build
myuser@srv:~$ cd ./xmr-stak/build
myuser@srv:~/xmr-stak/build$ export CFLAGS="-O2 -march=native -msse3 -fomit-frame-pointer -pipe"
myuser@srv:~/xmr-stak/build$ export CHOST="x86_64-pc-linux-gnu"
myuser@srv:~/xmr-stak/build$ export CXXFLAGS="${CFLAGS}"
myuser@srv:~/xmr-stak/build$ export LDFLAGS="-Wl,-O1"
myuser@srv:~/xmr-stak/build$ export CC=/usr/bin/gcc-6
myuser@srv:~/xmr-stak/build$ export CXX=/usr/bin/g++-6
myuser@srv:~/xmr-stak/build$ cmake ../
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/gcc-6
-- Check for working C compiler: /usr/bin/gcc-6 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-6
-- Check for working CXX compiler: /usr/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr (found suitable version "9.1", minimum required is "7.5") 
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "2.2") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0g") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myuser/xmr-stak/build
myuser@srv:~/xmr-stak/build$ make -j 16
Scanning dependencies of target xmr-stak-c
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 11%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 14%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 17%] Linking C static library bin/libxmr-stak-c.a
[ 17%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 20%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 22%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 25%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 28%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o
[ 37%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 45%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 48%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 51%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o
[ 54%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o
[ 60%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o
[ 62%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o
[ 65%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o
[ 68%] Linking CXX static library bin/libxmr-stak-backend.a
[ 68%] Built target xmr-stak-backend
[ 71%] Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o
[ 74%] Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o
Scanning dependencies of target xmr-stak
Scanning dependencies of target xmrstak_opencl_backend
[ 77%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/amd_gpu/gpu.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/minethd.cpp.o
[ 88%] Linking CXX executable bin/xmr-stak
[ 88%] Built target xmr-stak
[ 91%] Linking CXX shared library bin/libxmrstak_opencl_backend.so
[ 91%] Built target xmrstak_opencl_backend
Scanning dependencies of target xmrstak_cuda_backend
[ 94%] Building CXX object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/jconf.cpp.o
[ 97%] Building CXX object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/minethd.cpp.o
[100%] Linking CXX shared library bin/libxmrstak_cuda_backend.so
[100%] Built target xmrstak_cuda_backend
myuser@srv:~/xmr-stak/build$

STEP 5) Execute XMR-STAK, but before you must execute some tuning exports for the GPU and the linux kernel

Now is the time to use XMR-STAK.

myuser@srv:~/xmr-stak/build$ sudo sysctl -w vm.nr_hugepages=128
myuser@srv:~/xmr-stak/build$ export GPU_FORCE_64BIT_PTR=0
myuser@srv:~/xmr-stak/build$ export GPU_MAX_HEAP_SIZE=100
myuser@srv:~/xmr-stak/build$ export GPU_USE_SYNC_OBJECTS=1
myuser@srv:~/xmr-stak/build$ export GPU_MAX_ALLOC_PERCENT=100
myuser@srv:~/xmr-stak/build$ export GPU_SINGLE_ALLOC_PERCENT=100
myuser@srv:~/xmr-stak/build$ cd ./bin
myuser@srv:~/xmr-stak/build/bin$ ls -la
total 35804
drwxrwxr-x 2 myuser myuser     4096 Jul 19 16:13 .
drwxrwxr-x 4 myuser myuser     4096 Jul 19 16:05 ..
-rw-rw-r-- 1 myuser myuser  1614230 Jul 19 16:05 libxmr-stak-backend.a
-rw-rw-r-- 1 myuser myuser    75182 Jul 19 16:05 libxmr-stak-c.a
-rwxrwxr-x 1 myuser myuser 32570440 Jul 19 16:13 libxmrstak_cuda_backend.so
-rwxrwxr-x 1 myuser myuser  1307456 Jul 19 16:06 libxmrstak_opencl_backend.so
-rwxrwxr-x 1 myuser myuser  1075784 Jul 19 16:06 xmr-stak
myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak 

Always execute the exports before running the xmr-stak binary.
As you can see the XMR-STAK is in

./bin/xmr-stak

under the “~/xmr-stak/build”.

STEP 6) Mining with XMR-STAK.

Execute the program and follow the first run questions. Here you can see a MONERO configuration and the first run – Mining Monero with xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS.

* Options of the XMR-STAK program

As you can see all the algo you can use with this program – new and classic (the old) criptonight coins to mine like Monero, Electroneum, IntenseCoin and many more!

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak --help
Usage: xmr-stak [OPTION]...
 
  -h, --help                 show this help
  -v, --version              show version number
  -V, --version-long         show long version number
  -c, --config FILE          common miner configuration file
  -C, --poolconf FILE        pool configuration file
  --benchmark BLOCKVERSION   ONLY do a benchmark and exit
  --benchwait WAIT_SEC             ... benchmark wait time
  --benchwork WORK_SEC             ... benchmark work time
  --noCPU                    disable the CPU miner backend
  --cpu FILE                 CPU backend miner config file
  --noAMD                    disable the AMD miner backend
  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries
  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]
                             default: AMD
  --amd FILE                 AMD backend miner config file
  --noNVIDIA                 disable the NVIDIA miner backend
  --nvidia FILE              NVIDIA backend miner config file
  -i --httpd HTTP_PORT       HTTP interface port
 
The following options can be used for automatic start without a guided config,
If config exists then this pool will be top priority.
  -o, --url URL              pool url and port, e.g. pool.usxmrpool.com:3333
  -O, --tls-url URL          TLS pool url and port, e.g. pool.usxmrpool.com:10443
  -u, --user USERNAME        pool user name or wallet address
  -r, --rigid RIGID          rig identifier for pool-side statistics (needs pool support)
  -p, --pass PASSWD          pool password, in the most cases x or empty ""
  --use-nicehash             the pool should run in nicehash mode
  --currency NAME            currency to mine

Supported coin options: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

Version: xmr-stak 2.4.7 c5f0505
Brought to by fireice_uk and psychocrypt under GPLv3.

* Troubleshooting – the right version of GNU GCC

You must use GNU GCC 6, because version above 6 (7 and 8) are not supported by the NVIDIA 9.1 Toolkit. So if you end up with this error you must change to the version to 6 from 7 (the default in Ubuntu 18.04 LTS is GNU 7.3.0). GNU GCC 6 was installed as a dependency to NVIDIA 9.1 Toolkit in STEP 2) and we exported two environments “CC” and “CCX” in STEP 4)

[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o
In file included from /usr/include/host_config.h:50:0,
                 from /usr/include/cuda_runtime.h:78,
                 from <command-line>:0:
/usr/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
In file included from /usr/include/host_config.h:50:0,
                 from /usr/include/cuda_runtime.h:78,
                 from <command-line>:0:
/usr/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
CMake Error at xmrstak_cuda_backend_generated_cuda_core.cu.o.Release.cmake:219 (message):
  Error generating
  /home/myuser/xmr-stak/build/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/./xmrstak_cuda_backend_generated_cuda_core.cu.o


CMakeFiles/xmrstak_cuda_backend.dir/build.make:63: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o' failed
make[2]: *** [CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at xmrstak_cuda_backend_generated_cuda_extra.cu.o.Release.cmake:219 (message):
  Error generating
  /home/myuser/xmr-stak/build/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/./xmrstak_cuda_backend_generated_cuda_extra.cu.o


CMakeFiles/xmrstak_cuda_backend.dir/build.make:70: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o' failed
make[2]: *** [CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/all' failed
make[1]: *** [CMakeFiles/xmrstak_cuda_backend.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 88%] Linking CXX executable bin/xmr-stak
[ 88%] Built target xmr-stak
[ 91%] Linking CXX shared library bin/libxmrstak_opencl_backend.so
[ 91%] Built target xmrstak_opencl_backend
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

The solution is simple as said, just export CC and CXX before compilation in the same terminal console:

myuser@srv:~$ export CC=/usr/bin/gcc-6
myuser@srv:~$ export CXX=/usr/bin/g++-6

Mining Monero with xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS

Here are all the steps you need to begin mining Monero crypto coin with XMR-STAK 2.4. We can use our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition to mine along with our processor AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz). As you’ll see our processor has better performance with cryptonight v7 than our GPU.

STEP 1) Install all the needed software

  1. Install linux distro – Ubuntu 18.04 LTS
  2. Install NVIDIA proprietary driver
  3. Install NVIDIA CURA Toolkit
  4. Build XMR-STAK

This step is a matter of another howto, you can check all the step and detail explanations here – Install xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS. Skip it if you just followed the above howto and you want to see an example of how to mine the Monero coins with XMR-STAK using CPU and GPU power.

STEP 2) First run of XMR-STAK

If you followed our howto above you should have installed XMR-STAK in “~/xmr-stak/build/bin”, so all the examples will be run from this directory.

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak 
Please enter:
- Do you want to use the HTTP interface?
Unlike the screen display, the browser interface is not affected by the GPU lag.
If you don't want to use it, please enter 0, otherwise enter port number that the miner should listen on
0
Configuration stored in file 'config.txt'
Please enter:
- Please enter the currency that you want to mine: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

cryptonight_v7
- Pool address: e.g. pool.example.com:3333
pool.monero.spacepools.org:3333
- Username (wallet address or pool login):
111111111111111111111111111111111111111111111111111111111111111111111
- Password (mostly empty or x):
mining@example.com
- Rig identifier for pool-side statistics (needs pool support). Can be empty:

- Does this pool port support TLS/SSL? Use no if unknown. (y/N)
N
- Do you want to use nicehash on this pool? (y/n)
n
- Do you want to use multiple pools? (y/n)
n
Pool configuration stored in file 'pools.txt'
-------------------------------------------------------------------
xmr-stak 2.4.7 c5f0505

Brought to you by fireice_uk and psychocrypt under GPLv3.
Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).
Based on NVIDIA mining code by KlausT and psychocrypt.
Based on OpenCL mining code by wolf9466.

Configurable dev donation level is set to 2.0%

You can use following keys to display reports:
'h' - hashrate
'r' - results
'c' - connection
-------------------------------------------------------------------
[2018-07-20 03:13:52] : Mining coin: cryptonight_v7
[2018-07-20 03:13:52] : NVIDIA: GPU configuration stored in file 'nvidia.txt'
[2018-07-20 03:13:52] : Starting NVIDIA GPU thread 0, no affinity.
[2018-07-20 03:13:52] : WARNING: No AMD OpenCL platform found. Possible driver issues or wrong vendor driver.
[2018-07-20 03:13:52] : WARNING: backend AMD (OpenCL) disabled.
[2018-07-20 03:13:52] : CPU configuration stored in file 'cpu.txt'
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 0.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 1.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 2.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 3.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 4.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 5.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 6.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 7.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 8.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 9.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 10.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 11.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 12.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 13.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 14.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 15.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Fast-connecting to pool.monero.spacepools.org:3333 pool ...
[2018-07-20 03:13:52] : Pool pool.monero.spacepools.org:3333 connected. Logging in...
[2018-07-20 03:13:53] : Difficulty changed. Now: 50000.
[2018-07-20 03:13:53] : Pool logged in.
[2018-07-20 03:14:16] : Result accepted by the pool.
[2018-07-20 03:14:23] : Difficulty changed. Now: 35000.
[2018-07-20 03:14:23] : New block detected.
[2018-07-20 03:14:24] : Result accepted by the pool.
[2018-07-20 03:14:27] : Result accepted by the pool.
[2018-07-20 03:14:38] : Difficulty changed. Now: 45500.
[2018-07-20 03:14:38] : New block detected.
[2018-07-20 03:14:53] : Difficulty changed. Now: 31850.
[2018-07-20 03:14:53] : New block detected.
[2018-07-20 03:14:59] : Result accepted by the pool.
[2018-07-20 03:15:06] : Result accepted by the pool.
[2018-07-20 03:15:08] : Difficulty changed. Now: 41405.
[2018-07-20 03:15:08] : New block detected.
[2018-07-20 03:15:18] : Result accepted by the pool.
[2018-07-20 03:15:23] : Difficulty changed. Now: 51756.
[2018-07-20 03:15:23] : New block detected.
[2018-07-20 03:15:38] : Difficulty changed. Now: 38817.
[2018-07-20 03:15:38] : New block detected.
[2018-07-20 03:16:08] : New block detected.
[2018-07-20 03:16:08] : Difficulty changed. Now: 27172.
[2018-07-20 03:16:08] : New block detected.
[2018-07-20 03:16:08] : Result accepted by the pool.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   (na) |  1 |   80.7 |   80.7 |   (na) |
|  2 |   80.7 |   80.7 |   (na) |  3 |   80.7 |   80.7 |   (na) |
|  4 |   81.2 |   81.1 |   (na) |  5 |   81.2 |   81.1 |   (na) |
|  6 |   81.2 |   81.1 |   (na) |  7 |   81.2 |   81.1 |   (na) |
|  8 |   80.8 |   81.0 |   (na) |  9 |   80.5 |   81.0 |   (na) |
| 10 |   81.0 |   81.1 |   (na) | 11 |   81.0 |   81.0 |   (na) |
| 12 |   81.2 |   81.2 |   (na) | 13 |   81.2 |   81.2 |   (na) |
| 14 |   81.1 |   81.1 |   (na) | 15 |   81.2 |   81.2 |   (na) |
Totals (CPU):  1295.2 1295.8    0.0 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  772.2 |   (na) |
Totals (NVIDIA):     0.0  772.2    0.0 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.2 2068.0    0.0 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
[2018-07-20 03:16:15] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 27172
Good results     : 8 / 8 (100.0 %)
Avg result time  : 17.6 sec
Pool-side hashes : 279449

Top 10 best results found:
|  0 |           179318 |  1 |            98494 |
|  2 |            65145 |  3 |            59550 |
|  4 |            58982 |  5 |            50332 |
|  6 |            42050 |  7 |            34703 |
|  8 |                0 |  9 |                0 |

Error details:
Yay! No errors.
[2018-07-20 03:16:23] : Difficulty changed. Now: 35324.
[2018-07-20 03:16:23] : New block detected.
[2018-07-20 03:16:38] : Difficulty changed. Now: 24727.
[2018-07-20 03:16:38] : New block detected.
[2018-07-20 03:16:42] : Result accepted by the pool.
[2018-07-20 03:16:49] : Result accepted by the pool.
[2018-07-20 03:16:53] : Difficulty changed. Now: 32145.
[2018-07-20 03:16:53] : New block detected.
[2018-07-20 03:16:55] : Result accepted by the pool.
[2018-07-20 03:17:08] : Difficulty changed. Now: 41789.
[2018-07-20 03:17:08] : New block detected.
[2018-07-20 03:17:23] : Difficulty changed. Now: 29252.
[2018-07-20 03:17:23] : New block detected.
[2018-07-20 03:17:47] : Result accepted by the pool.
[2018-07-20 03:17:53] : Difficulty changed. Now: 20476.
[2018-07-20 03:17:53] : New block detected.
[2018-07-20 03:17:54] : Result accepted by the pool.
[2018-07-20 03:18:00] : Result accepted by the pool.
[2018-07-20 03:18:08] : Difficulty changed. Now: 26619.
[2018-07-20 03:18:08] : New block detected.
[2018-07-20 03:18:15] : Result accepted by the pool.
[2018-07-20 03:18:21] : Result accepted by the pool.
[2018-07-20 03:18:23] : Difficulty changed. Now: 34605.
[2018-07-20 03:18:23] : New block detected.
[2018-07-20 03:18:30] : Result accepted by the pool.
[2018-07-20 03:18:30] : Result accepted by the pool.
[2018-07-20 03:18:36] : Result accepted by the pool.
[2018-07-20 03:18:38] : Difficulty changed. Now: 44987.
[2018-07-20 03:18:38] : New block detected.
[2018-07-20 03:18:53] : Difficulty changed. Now: 39694.
[2018-07-20 03:18:53] : New block detected.
[2018-07-20 03:18:55] : Result accepted by the pool.
[2018-07-20 03:18:56] : Result accepted by the pool.
[2018-07-20 03:19:08] : Difficulty changed. Now: 51602.
[2018-07-20 03:19:08] : New block detected.
[2018-07-20 03:19:23] : Difficulty changed. Now: 36121.
[2018-07-20 03:19:23] : New block detected.
[2018-07-20 03:19:28] : New block detected.
[2018-07-20 03:19:37] : Result accepted by the pool.
[2018-07-20 03:20:01] : Result accepted by the pool.
[2018-07-20 03:20:08] : Difficulty changed. Now: 28517.
[2018-07-20 03:20:08] : New block detected.
[2018-07-20 03:20:08] : New block detected.
[2018-07-20 03:20:23] : Difficulty changed. Now: 19962.
[2018-07-20 03:20:23] : New block detected.
[2018-07-20 03:20:23] : Result accepted by the pool.
[2018-07-20 03:20:30] : Result accepted by the pool.
[2018-07-20 03:20:31] : Result accepted by the pool.
[2018-07-20 03:20:38] : Difficulty changed. Now: 25951.
[2018-07-20 03:20:38] : New block detected.
[2018-07-20 03:20:45] : Result accepted by the pool.
[2018-07-20 03:21:08] : Difficulty changed. Now: 21041.
[2018-07-20 03:21:08] : New block detected.
[2018-07-20 03:21:18] : Result accepted by the pool.
[2018-07-20 03:21:23] : Difficulty changed. Now: 27353.
[2018-07-20 03:21:23] : New block detected.
[2018-07-20 03:21:26] : Result accepted by the pool.
[2018-07-20 03:21:32] : Result accepted by the pool.
[2018-07-20 03:21:35] : Result accepted by the pool.
[2018-07-20 03:21:38] : Difficulty changed. Now: 35559.
[2018-07-20 03:21:38] : New block detected.
[2018-07-20 03:21:53] : Difficulty changed. Now: 29633.
[2018-07-20 03:21:53] : New block detected.
[2018-07-20 03:21:55] : Result accepted by the pool.
[2018-07-20 03:22:08] : Difficulty changed. Now: 38523.
[2018-07-20 03:22:08] : New block detected.
[2018-07-20 03:22:23] : Difficulty changed. Now: 26966.
[2018-07-20 03:22:23] : New block detected.
[2018-07-20 03:22:28] : Result accepted by the pool.
[2018-07-20 03:22:38] : Difficulty changed. Now: 35056.
[2018-07-20 03:22:38] : New block detected.
[2018-07-20 03:22:49] : Result accepted by the pool.
[2018-07-20 03:22:52] : Result accepted by the pool.
[2018-07-20 03:22:53] : Difficulty changed. Now: 43820.
[2018-07-20 03:22:53] : New block detected.
[2018-07-20 03:23:00] : Result accepted by the pool.
[2018-07-20 03:23:08] : Difficulty changed. Now: 56966.
[2018-07-20 03:23:08] : New block detected.
[2018-07-20 03:23:13] : Result accepted by the pool.
[2018-07-20 03:23:23] : Difficulty changed. Now: 65730.
[2018-07-20 03:23:23] : New block detected.
[2018-07-20 03:23:23] : Result accepted by the pool.
[2018-07-20 03:23:30] : New block detected.
[2018-07-20 03:23:38] : Difficulty changed. Now: 85449.
[2018-07-20 03:23:38] : New block detected.
[2018-07-20 03:23:53] : Difficulty changed. Now: 59814.
[2018-07-20 03:23:53] : New block detected.
[2018-07-20 03:24:07] : Result accepted by the pool.
[2018-07-20 03:24:35] : New block detected.
[2018-07-20 03:24:38] : Difficulty changed. Now: 41870.
[2018-07-20 03:24:38] : New block detected.
[2018-07-20 03:25:08] : Difficulty changed. Now: 29309.
[2018-07-20 03:25:08] : New block detected.
[2018-07-20 03:25:38] : Difficulty changed. Now: 20516.
[2018-07-20 03:25:38] : New block detected.
[2018-07-20 03:25:49] : Result accepted by the pool.
[2018-07-20 03:25:53] : Difficulty changed. Now: 26671.
[2018-07-20 03:25:53] : New block detected.
[2018-07-20 03:26:08] : Difficulty changed. Now: 21056.
[2018-07-20 03:26:08] : New block detected.
[2018-07-20 03:26:15] : Result accepted by the pool.
[2018-07-20 03:26:22] : Result accepted by the pool.
[2018-07-20 03:26:23] : Difficulty changed. Now: 27373.
[2018-07-20 03:26:23] : New block detected.
[2018-07-20 03:26:52] : Result accepted by the pool.
[2018-07-20 03:26:53] : Difficulty changed. Now: 19161.
[2018-07-20 03:26:53] : New block detected.
[2018-07-20 03:26:56] : Result accepted by the pool.
[2018-07-20 03:27:08] : Difficulty changed. Now: 24909.
[2018-07-20 03:27:08] : New block detected.
[2018-07-20 03:27:19] : Result accepted by the pool.
[2018-07-20 03:27:23] : Difficulty changed. Now: 17436.
[2018-07-20 03:27:23] : New block detected.
[2018-07-20 03:27:26] : Result accepted by the pool.
[2018-07-20 03:27:36] : Result accepted by the pool.
[2018-07-20 03:27:38] : Difficulty changed. Now: 22667.
[2018-07-20 03:27:38] : New block detected.
[2018-07-20 03:27:43] : Result accepted by the pool.
[2018-07-20 03:27:43] : Result accepted by the pool.
[2018-07-20 03:27:49] : Result accepted by the pool.
[2018-07-20 03:27:53] : Difficulty changed. Now: 29467.
[2018-07-20 03:27:53] : New block detected.
[2018-07-20 03:27:57] : Result accepted by the pool.
[2018-07-20 03:28:00] : Result accepted by the pool.
[2018-07-20 03:28:03] : Result accepted by the pool.
[2018-07-20 03:28:08] : Difficulty changed. Now: 38307.
[2018-07-20 03:28:08] : New block detected.
[2018-07-20 03:28:23] : Difficulty changed. Now: 28730.
[2018-07-20 03:28:23] : New block detected.
[2018-07-20 03:28:30] : Result accepted by the pool.
[2018-07-20 03:28:30] : Result accepted by the pool.
[2018-07-20 03:28:35] : Result accepted by the pool.
[2018-07-20 03:28:37] : Result accepted by the pool.
[2018-07-20 03:28:37] : Result accepted by the pool.
[2018-07-20 03:28:38] : Difficulty changed. Now: 37349.
[2018-07-20 03:28:38] : New block detected.
[2018-07-20 03:29:07] : Result accepted by the pool.
[2018-07-20 03:29:08] : Difficulty changed. Now: 26144.
[2018-07-20 03:29:08] : New block detected.
[2018-07-20 03:29:36] : Result accepted by the pool.
[2018-07-20 03:29:38] : Result accepted by the pool.
[2018-07-20 03:29:38] : Difficulty changed. Now: 18301.
[2018-07-20 03:29:38] : New block detected.
[2018-07-20 03:29:41] : Result accepted by the pool.
[2018-07-20 03:29:45] : Result accepted by the pool.
[2018-07-20 03:29:50] : Result accepted by the pool.
[2018-07-20 03:29:53] : Difficulty changed. Now: 23791.
[2018-07-20 03:29:53] : New block detected.
[2018-07-20 03:29:58] : New block detected.
[2018-07-20 03:29:58] : Result accepted by the pool.
[2018-07-20 03:30:08] : Difficulty changed. Now: 30928.
[2018-07-20 03:30:08] : New block detected.
[2018-07-20 03:30:12] : Result accepted by the pool.
[2018-07-20 03:30:13] : Result accepted by the pool.
[2018-07-20 03:30:23] : Difficulty changed. Now: 40206.
[2018-07-20 03:30:23] : New block detected.
[2018-07-20 03:30:24] : Result accepted by the pool.
[2018-07-20 03:30:38] : Difficulty changed. Now: 52268.
[2018-07-20 03:30:38] : New block detected.
[2018-07-20 03:30:53] : Difficulty changed. Now: 36588.
[2018-07-20 03:30:53] : New block detected.
[2018-07-20 03:31:23] : Difficulty changed. Now: 25612.
[2018-07-20 03:31:23] : New block detected.
[2018-07-20 03:31:53] : Difficulty changed. Now: 17928.
[2018-07-20 03:31:53] : New block detected.
[2018-07-20 03:31:53] : Result accepted by the pool.
[2018-07-20 03:32:08] : Difficulty changed. Now: 23306.
[2018-07-20 03:32:08] : New block detected.
[2018-07-20 03:32:14] : Result accepted by the pool.
[2018-07-20 03:32:20] : Result accepted by the pool.
[2018-07-20 03:32:53] : Difficulty changed. Now: 17480.
[2018-07-20 03:32:53] : New block detected.
RESULT REPORT
Difficulty       : 17480
Good results     : 71 / 71 (100.0 %)
Avg result time  : 16.2 sec
Pool-side hashes : 2085841

Top 10 best results found:
|  0 |          4672722 |  1 |           993908 |
|  2 |           991887 |  3 |           271993 |
|  4 |           210975 |  5 |           208951 |
|  6 |           207738 |  7 |           179318 |
|  8 |           144045 |  9 |           118699 |

Error details:
Yay! No errors.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.7 |   80.7 |   80.7 |
|  2 |   80.7 |   80.7 |   80.7 |  3 |   80.7 |   80.7 |   80.7 |
|  4 |   81.2 |   81.2 |   81.2 |  5 |   81.2 |   81.2 |   81.2 |
|  6 |   81.2 |   81.2 |   81.1 |  7 |   81.2 |   81.2 |   81.2 |
|  8 |   80.7 |   81.1 |   81.0 |  9 |   80.9 |   81.1 |   81.1 |
| 10 |   80.9 |   81.0 |   81.0 | 11 |   80.9 |   81.1 |   81.1 |
| 12 |   81.0 |   81.1 |   81.1 | 13 |   81.1 |   81.1 |   81.2 |
| 14 |   81.1 |   81.1 |   81.1 | 15 |   81.1 |   81.1 |   81.2 |
Totals (CPU):  1295.1 1296.0 1295.9 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  771.7 |  771.5 |
Totals (NVIDIA):     0.0  771.7  771.5 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.1 2067.7 2067.4 H/s
Highest:  2069.9 H/s
-----------------------------------------------------------------
[2018-07-20 03:33:07] : Result accepted by the pool.
[2018-07-20 03:33:09] : Result accepted by the pool.

You could use monero7 or cryptonight_v7to mine Monero. The pool we use is under “Pool address:” – pool.monero.spacepools.org:3333 You cannot mine crypto without to be part of a pool of other mining “people”, because the difficulty is too big for solo mining! So choose your mining pool carefully – by the “Total Pool Fee”, which for the Spacepools is 0.1% and the stability of the pool.
The username is your MONERO wallet address (we changed our to invalid 111111111111111111111111111111111111111111111111111111111111111111111, DO NOT USE THIS ADDRESS) – check this to see how you can generate monero wallet address – Generate a new Monero address (wallet). The password in most cases is your email address, with which you could change some account information in the pool web page.

It is good to see

Result accepted by the pool.

it means your discovered a hash and you are going to be awarded by the pool for your mining share! As many as “accepted results” as good as for you!

As you can see our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition without any overclocking has 771.5 H/s of Cryptonight v7 algorithm!
Our AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz) without any overclocking has 1295.1 of Cryptonight v7 algorithm! The performance of the CPU is almost double the performance of the GPU.
Our motherboard is ASUS ROG ZENITH EXTREME with 4x8Gbytes (G.Skill Trident Z RGB DIMM Kit 32GB F4-3200C14Q-32GTZR) of RAM running in fourth channel mode.

There are three control keys to display additional information of your XMR-STAK. Press one of the key during the program execution. In the above first run we used “h” and “r”.

'h' - hashrate
'r' - results
'c' - connection

And here is the stat after 5 hours:

[2018-07-20 08:42:32] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 27881
Good results     : 1266 / 1266 (100.0 %)
Avg result time  : 15.6 sec
Pool-side hashes : 41195382

Top 10 best results found:
|  0 |         86854459 |  1 |         47586423 |
|  2 |         35768342 |  3 |         25208619 |
|  4 |          8208523 |  5 |          7828657 |
|  6 |          6669723 |  7 |          6490827 |
|  8 |          6448233 |  9 |          5964065 |

Error details:
Yay! No errors.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.8 |   80.8 |   80.8 |
|  2 |   80.8 |   80.8 |   80.8 |  3 |   80.8 |   80.8 |   80.8 |
|  4 |   81.2 |   81.1 |   81.1 |  5 |   81.2 |   81.1 |   81.1 |
|  6 |   81.2 |   81.1 |   81.1 |  7 |   81.2 |   81.1 |   81.1 |
|  8 |   81.0 |   80.9 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.0 |   80.9 | 11 |   80.5 |   80.8 |   81.0 |
| 12 |   81.2 |   81.1 |   81.1 | 13 |   81.2 |   81.2 |   81.2 |
| 14 |   81.2 |   81.2 |   81.1 | 15 |   81.2 |   81.2 |   81.1 |
Totals (CPU):  1295.7 1295.5 1295.7 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |  773.0 |  769.9 |  771.6 |
Totals (NVIDIA):   773.0  769.9  771.6 H/s
-----------------------------------------------------------------
Totals (ALL):   2068.8 2065.4 2067.3 H/s
Highest:  2069.9 H/s
-----------------------------------------------------------------
[2018-07-20 08:42:42] : Result accepted by the pool.
[2018-07-20 08:42:43] : Difficulty changed. Now: 36245.
[2018-07-20 08:42:43] : New block detected.

Here we use https://dwarfpool.com/ and after 14 hours of mining:

[2018-07-21 02:21:05] : New block detected.
[2018-07-21 02:21:24] : Result accepted by the pool.
[2018-07-21 02:21:31] : Result accepted by the pool.
[2018-07-21 02:21:55] : Result accepted by the pool.
[2018-07-21 02:22:09] : Result accepted by the pool.
[2018-07-21 02:22:32] : Result accepted by the pool.
[2018-07-21 02:23:03] : Result accepted by the pool.
[2018-07-21 02:23:05] : Result accepted by the pool.
[2018-07-21 02:23:19] : Result accepted by the pool.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.8 |   80.8 |   80.8 |
|  2 |   80.8 |   80.8 |   80.8 |  3 |   80.8 |   80.8 |   80.8 |
|  4 |   81.2 |   81.1 |   81.2 |  5 |   81.2 |   81.1 |   81.2 |
|  6 |   81.2 |   81.1 |   81.1 |  7 |   81.2 |   81.1 |   81.2 |
|  8 |   81.0 |   80.9 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.0 |   81.0 | 11 |   81.0 |   80.8 |   81.0 |
| 12 |   81.1 |   81.2 |   81.2 | 13 |   81.1 |   81.2 |   81.2 |
| 14 |   81.1 |   81.1 |   81.1 | 15 |   81.0 |   81.2 |   81.2 |
Totals (CPU):  1295.8 1295.5 1295.8 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  769.5 |  771.1 |
Totals (NVIDIA):     0.0  769.5  771.1 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.8 2065.0 2066.9 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
RESULT REPORT
Difficulty       : 50000
Good results     : 2592 / 2595 (99.9 %)
Avg result time  : 23.1 sec
Pool-side hashes : 3300000

Top 10 best results found:
|  0 |       1257001197 |  1 |         62229932 |
|  2 |         58697077 |  3 |         13938510 |
|  4 |         13393176 |  5 |         12264166 |
|  6 |         10357917 |  7 |          8800621 |
|  8 |          8669175 |  9 |          8547001 |

Error details:
| Count | Error text                       | Last seen           |
|     3 | [NETWORK ERROR]                  | 2018-07-20 19:26:18 |
[2018-07-21 02:45:48] : Result accepted by the pool.
[2018-07-21 02:45:50] : Result accepted by the pool.
[2018-07-21 02:46:11] : New block detected.
[2018-07-21 02:46:13] : New block detected.
[2018-07-21 02:46:44] : Result accepted by the pool.
[2018-07-21 02:46:53] : Result accepted by the pool.
[2018-07-21 02:47:21] : Result accepted by the pool.
[2018-07-21 02:47:33] : Result accepted by the pool.
[2018-07-21 02:47:48] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 50000
Good results     : 2657 / 2660 (99.9 %)
Avg result time  : 20.8 sec
Pool-side hashes : 1000000

Top 10 best results found:
|  0 |       1257001197 |  1 |         62229932 |
|  2 |         58697077 |  3 |         13938510 |
|  4 |         13393176 |  5 |         12264166 |
|  6 |         10357917 |  7 |          8800621 |
|  8 |          8669175 |  9 |          8547001 |

Error details:
| Count | Error text                       | Last seen           |
|     3 | [NETWORK ERROR]                  | 2018-07-20 19:26:18 |
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.2 |   80.3 |   77.5 |  1 |   80.7 |   80.7 |   77.9 |
|  2 |   80.7 |   80.7 |   77.9 |  3 |   80.7 |   80.7 |   77.9 |
|  4 |   81.1 |   81.1 |   78.3 |  5 |   81.1 |   81.1 |   78.3 |
|  6 |   81.1 |   81.1 |   78.3 |  7 |   81.1 |   81.1 |   78.3 |
|  8 |   81.1 |   81.0 |   78.2 |  9 |   81.1 |   81.1 |   78.2 |
| 10 |   81.1 |   81.0 |   78.2 | 11 |   81.1 |   81.1 |   78.2 |
| 12 |   81.0 |   81.1 |   78.3 | 13 |   81.1 |   81.1 |   78.3 |
| 14 |   81.0 |   81.1 |   78.3 | 15 |   81.1 |   81.1 |   78.3 |
Totals (CPU):  1295.2 1295.5 1250.7 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  770.5 |  745.5 |
Totals (NVIDIA):     0.0  770.5  745.5 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.2 2066.0 1996.1 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
[2018-07-21 02:48:40] : New block detected.

The difficult is constant 50000 and you see we have multiple results, so we can try to higher it with another port (check for this the configuration page of the pool – https://dwarfpool.com/xmr/). The stats is “Earning in last 24 hours: 0.00753535 XMR”, “Current balance: 0.00732356 XMR” and ” Unconfirmed: 0.00078419 XMR” (in most cases all of it will be confirmed successfully), so the total monero we mined is “0.00810775 XMR” for these 14 hours with our machine and the estimate for the next 24 hours is “0.01440000 XMR” (for the current price you’ll earn 1.832300 USD for 24hours with this machine).

Here is the https://dwarfpool.com/xmr/ with almost 24 hours with difficult 100 000:

[2018-07-22 02:04:35] : Result accepted by the pool.
[2018-07-22 02:04:37] : Result accepted by the pool.
[2018-07-22 02:04:44] : Result accepted by the pool.
[2018-07-22 02:05:29] : Result accepted by the pool.
[2018-07-22 02:05:29] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 100001
Good results     : 1691 / 1693 (99.9 %)
Avg result time  : 35.2 sec
Pool-side hashes : 4800048

Top 10 best results found:
|  0 |         50511124 |  1 |         32008411 |
|  2 |         27907718 |  3 |         27563158 |
|  4 |         20638537 |  5 |         19189255 |
|  6 |         18843649 |  7 |         15123109 |
|  8 |         12496904 |  9 |         12222295 |

Error details:
| Count | Error text                       | Last seen           |
|     1 | Low difficulty share             | 2018-07-21 15:11:03 |
|     1 | [NETWORK ERROR]                  | 2018-07-21 17:22:50 |
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.7 |   80.7 |   80.7 |
|  2 |   80.7 |   80.7 |   80.7 |  3 |   80.7 |   80.7 |   80.7 |
|  4 |   81.1 |   81.2 |   81.1 |  5 |   81.1 |   81.2 |   81.1 |
|  6 |   80.8 |   81.1 |   81.1 |  7 |   81.1 |   81.2 |   81.1 |
|  8 |   80.9 |   81.0 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.1 |   81.1 | 11 |   81.0 |   81.1 |   81.1 |
| 12 |   81.0 |   81.1 |   81.1 | 13 |   81.0 |   81.1 |   81.1 |
| 14 |   80.9 |   81.1 |   81.1 | 15 |   81.0 |   81.1 |   81.1 |
Totals (CPU):  1294.5 1295.8 1295.6 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |  771.4 |  770.7 |  771.0 |
Totals (NVIDIA):   771.4  770.7  771.0 H/s
-----------------------------------------------------------------
Totals (ALL):   2065.9 2066.5 2066.7 H/s
Highest:  2069.7 H/s
-----------------------------------------------------------------
[2018-07-22 02:06:15] : New block detected.

Current balance: 0.01082526 XMR, Unconfirmed: 0.00242919 XMR, the total is: 0.01325445 XMR, Earning in last 24 hours: 0.00603805 XMR. Next 24h earning with this speed: 0.01850000 XMR (with the current price of Monero 2.455200 USD) very approximated avg_24h_diff = 54061666755.14

Here is the nvidia-smi output

myuser@srv:~/xmr-stak/build/bin$ nvidia-smi 
Fri Jul 20 03:38:52 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24.10              Driver Version: 396.24.10                 |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:0A:00.0  On |                  N/A |
| 46%   64C    P2   143W / 275W |  10711MiB / 11173MiB |    100%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2119      G   /usr/lib/xorg/Xorg                            59MiB |
|    0      2170      G   /usr/bin/gnome-shell                          70MiB |
|    0     20146      C   ./xmr-stak                                 10577MiB |
+-----------------------------------------------------------------------------+

The GPU is using 143W and here is the used GPU RAM 10711MiB out of 11173MiB by xmr-stak.
All CPU cores are running at 3680.374 Mhz. The uptime is

myuser@srv:~/xmr-stak/build/bin$ uptime
 03:48:37 up 18:28,  3 users,  load average: 16.04, 16.05, 14.39

After the first run there will be created 4 files in your current directory of the xmr-stak binary:

myuser@srv:~/xmr-stak/build/bin$ ls -altr
total 35824
drwxrwxr-x 4 myuser myuser     4096 Jul 19 16:05 ..
-rw-rw-r-- 1 myuser myuser    75182 Jul 19 16:05 libxmr-stak-c.a
-rw-rw-r-- 1 myuser myuser  1614230 Jul 19 16:05 libxmr-stak-backend.a
-rwxrwxr-x 1 myuser myuser  1075784 Jul 19 16:06 xmr-stak
-rwxrwxr-x 1 myuser myuser  1307456 Jul 19 16:06 libxmrstak_opencl_backend.so
-rwxrwxr-x 1 myuser myuser 32570440 Jul 19 16:13 libxmrstak_cuda_backend.so
-rw-rw-r-- 1 myuser myuser     7228 Jul 20 03:10 config.txt
-rw-rw-r-- 1 myuser myuser     2087 Jul 20 03:13 pools.txt
-rw-rw-r-- 1 myuser myuser     2032 Jul 20 03:13 nvidia.txt
-rw-rw-r-- 1 myuser myuser     2963 Jul 20 03:13 cpu.txt
drwxrwxr-x 2 myuser myuser     4096 Jul 20 03:13 .
myuser@srv:~/xmr-stak/build/bin$

The configuration files are

  • config.txt – the general config
  • pools.txt – configuration for what coin your are mining and which pool you are using. You can tune the rig naming and additional pools.
  • nvidia.txt – configuration for GPU miner part – GPU threads, blocks and affine_to_cpu. Definitely check this out.
  • cpu.txt – configuration for the cpu miner part – Thread configuration for each thread – a line for each core. CPU affinity, power mode and more.

These files are generated on the first run with default values and then you could quit the xmr-stak and edit the files with text editor.

* Options of the XMR-STAK program

As you can see all the algo you can use with this program – new and classic (the old) criptonight coins to mine like Monero, Electroneum, IntenseCoin and many more!

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak --help
Usage: xmr-stak [OPTION]...
 
  -h, --help                 show this help
  -v, --version              show version number
  -V, --version-long         show long version number
  -c, --config FILE          common miner configuration file
  -C, --poolconf FILE        pool configuration file
  --benchmark BLOCKVERSION   ONLY do a benchmark and exit
  --benchwait WAIT_SEC             ... benchmark wait time
  --benchwork WORK_SEC             ... benchmark work time
  --noCPU                    disable the CPU miner backend
  --cpu FILE                 CPU backend miner config file
  --noAMD                    disable the AMD miner backend
  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries
  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]
                             default: AMD
  --amd FILE                 AMD backend miner config file
  --noNVIDIA                 disable the NVIDIA miner backend
  --nvidia FILE              NVIDIA backend miner config file
  -i --httpd HTTP_PORT       HTTP interface port
 
The following options can be used for automatic start without a guided config,
If config exists then this pool will be top priority.
  -o, --url URL              pool url and port, e.g. pool.usxmrpool.com:3333
  -O, --tls-url URL          TLS pool url and port, e.g. pool.usxmrpool.com:10443
  -u, --user USERNAME        pool user name or wallet address
  -r, --rigid RIGID          rig identifier for pool-side statistics (needs pool support)
  -p, --pass PASSWD          pool password, in the most cases x or empty ""
  --use-nicehash             the pool should run in nicehash mode
  --currency NAME            currency to mine

Supported coin options: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

Version: xmr-stak 2.4.7 c5f0505
Brought to by fireice_uk and psychocrypt under GPLv3.

QEMU full virtualization – CPU emulations (enable/disable CPU flags/instruction sets) of QEMU 2.0.0

After the two QEMU full virtualization howtos

You can use QEMU with a nearly native full virtualization. Here are some important tips for the guest CPU to consider when using QEMU directly (without any virtualization manager like virt-manager, libvirt and so on).

TIP 1)Choose your host CPU emulation

You can see what options are available for host emulation with:

srv@local ~$ qemu-system-x86_64 -cpu help

x86           qemu64  QEMU Virtual CPU version 2.0.0                  
x86           phenom  AMD Phenom(tm) 9550 Quad-Core Processor         
x86         core2duo  Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz 
x86            kvm64  Common KVM processor                            
x86           qemu32  QEMU Virtual CPU version 2.0.0                  
x86            kvm32  Common 32-bit KVM processor                     
x86          coreduo  Genuine Intel(R) CPU           T2600  @ 2.16GHz 
x86              486                                                  
x86          pentium                                                  
x86         pentium2                                                  
x86         pentium3                                                  
x86           athlon  QEMU Virtual CPU version 2.0.0                  
x86             n270  Intel(R) Atom(TM) CPU N270   @ 1.60GHz          
x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)   
x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)    
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)       
x86         Westmere  Westmere E56xx/L56xx/X56xx (Nehalem-C)          
x86      SandyBridge  Intel Xeon E312xx (Sandy Bridge)                
x86          Haswell  Intel Core Processor (Haswell)                  
x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)           
x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)          
x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)          
x86       Opteron_G4  AMD Opteron 62xx class CPU                      
x86       Opteron_G5  AMD Opteron 63xx class CPU                      
x86             host  KVM processor with all supported host features (only available in KVM mode)

Recognized CPUID flags:
  pbe ia64 tm ht ss sse2 sse fxsr mmx acpi ds clflush pn pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de vme fpu
  hypervisor rdrand f16c avx osxsave xsave aes tsc-deadline popcnt movbe x2apic sse4.2|sse4_2 sse4.1|sse4_1 dca pcid pdcm xtpr cx16 fma cid ssse3 tm2 est smx vmx ds_cpl monitor dtes64 pclmulqdq|pclmuldq pni|sse3
  smap adx rdseed rtm invpcid erms bmi2 smep avx2 hle bmi1 fsgsbase
  3dnow 3dnowext lm|i64 rdtscp pdpe1gb fxsr_opt|ffxsr mmxext nx|xd syscall
  perfctr_nb perfctr_core topoext tbm nodeid_msr tce fma4 lwp wdt skinit xop ibs osvw 3dnowprefetch misalignsse sse4a abm cr8legacy extapic svm cmp_legacy lahf_lm
  pmm-en pmm phe-en phe ace2-en ace2 xcrypt-en xcrypt xstore-en xstore
  kvm_pv_unhalt kvm_pv_eoi kvm_steal_time kvm_asyncpf kvmclock kvm_mmu kvm_nopiodelay kvmclock
  pfthreshold pause_filter decodeassists flushbyasid vmcb_clean tsc_scale nrip_save svm_lock lbrv npt

The host server will expose different instruction set to the guest server (the emulated CPU), so when you choose your host to emulate for example “qemu64” with:

qemu-system-x86_64 -enable-kvm  \
-cpu qemu64,+ssse3,+sse4.1,+sse4.2,+x2apic -smp 2,maxcpus=8 \
-daemonize -vnc 192.168.0.10:1 \
-drive file=/mnt/storage/qemu/roofs/srv_virt.qcow2,index=0,cache=none,aio=threads,if=virtio \
-cdrom /mnt/storage/images/install-amd64-minimal-20140327.iso -boot d \
-net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) \
-net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex) \
-balloon virtio -m 8192 \
-monitor telnet:127.0.0.1:5801,server,nowait -writeconfig /opt/qemu/config/srv_virt.qcow2.conf

The guest server (the virtual machine) will have the following CPU and instruction set:

vendor_id       : GenuineIntel
cpu family      : 6
model           : 6
model name      : QEMU Virtual CPU version 2.0.0
stepping        : 3
microcode       : 0x1
cpu MHz         : 2133.408
cache size      : 4096 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni ssse3 cx16 sse4_1 x2apic popcnt hypervisor lahf_lm
bogomips        : 4266.81
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 6
model name      : QEMU Virtual CPU version 2.0.0
stepping        : 3
microcode       : 0x1
cpu MHz         : 2133.408
cache size      : 4096 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni ssse3 cx16 sse4_1 x2apic popcnt hypervisor lahf_lm
bogomips        : 4266.81
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

A base set of instructions (flags) with the explicitly included by our command with

+ssse3,+sse4.1,+sse4.2,+x2apic

. The format:

-cpu qemu64,+ssse3,+sse4.1,+sse4.2,+x2apic

IF you choose the last option:

-cpu host

the host server will try to emulate and expose to the virtual machine its processor and all flags:

qemu-system-x86_64 -enable-kvm  \
-cpu host -smp 2,maxcpus=8 \
-daemonize -vnc 192.168.0.10:1 \
-drive file=/mnt/storage/qemu/roofs/srv_virt.qcow2,index=0,cache=none,aio=threads,if=virtio \
-cdrom /mnt/storage/images/install-amd64-minimal-20140327.iso -boot d \
-net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) \
-net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex) \
-balloon virtio -m 8192 \
-monitor telnet:127.0.0.1:5801,server,nowait -writeconfig /opt/qemu/config/srv_virt.qcow2.conf

The virtual machine:

[root@vm0 ~]# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5606  @ 2.13GHz
stepping        : 2
microcode       : 0x1
cpu MHz         : 2133.408
cache size      : 8192 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm tsc_adjust
bogomips        : 4266.81
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

The host server:

[root@srv0 ~]# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5606  @ 2.13GHz
stepping        : 2
microcode       : 0x14
cpu MHz         : 1200.000
cache size      : 8192 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm arat
bogomips        : 4266.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

TIP 2) Disable certain CPU flags (instruction sets)

As you can see with the above CPU options you can hide your exact type of processor and you could disable specific CPU flags (instruction sets) to the user’s virtual machine. The purpose is up to the user and one reason for example could be not offer “avx” (or “avx2”) to discourage crypto mining with the virtual machine. Or limit the SSE2/3/4/4.2/SSSE3 and other “multimedia” instruction sets to discourage video encoding and so on. Probably you would like to be used It’s up to you what to offer to the virtual machine user.
Here is the command to emulate the host CPU with all supported flags but disable “sse4.1” and “sse4.2”:
The syntax:

-cpu host,-sse4.1,-sse4.2

And the qemu command is:

qemu-system-x86_64 -enable-kvm \
-cpu host,-sse4.1,-sse4.2 \
-smp 2,maxcpus=8 \
-daemonize -vnc 192.168.0.10:1 \
-drive file=/mnt/storage/qemu/roofs/srv_virt.qcow2,index=0,cache=none,aio=threads,if=virtio \
-cdrom /mnt/storage/images/install-amd64-minimal-20140327.iso -boot d \
-net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) \
-net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex) \
-balloon virtio -m 8192 \
-monitor telnet:127.0.0.1:5801,server,nowait -writeconfig /opt/qemu/config/srv_virt.qcow2.conf

So the virtual machine lacks the disabled flags:

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl pni pclmulqdq ssse3 cx16 pcid x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm tsc_adjust

TIP 3) Number of virtual processors in the virtual machine

The syntax

-smp 2,maxcpus=8

of the qemu command:

qemu-system-x86_64 -enable-kvm  -cpu host \
-smp 2,maxcpus=8 \
-daemonize -vnc 192.168.0.10:1 \
-drive file=/mnt/storage/qemu/roofs/srv_virt.qcow2,index=0,cache=none,aio=threads,if=virtio \
-cdrom /mnt/storage/images/install-amd64-minimal-20140327.iso -boot d \
-net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) \
-net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex) \
-balloon virtio -m 8192 \
-monitor telnet:127.0.0.1:5801,server,nowait -writeconfig /opt/qemu/config/srv_virt.qcow2.conf

will start up the virtual machine with 2 processors and you can hot add a cpu up to 8 total in any time you want with the management console listening on 127.0.0.1:5801.

Howto do QEMU full virtualization with bridged networking

This howto rather continues the previous one “Howto do QEMU full virtualization with MacVTap networking” with the exception it will be showed how to use a classic setup of the networking – the use of bridge device. Because this setup requires a specific configuration for every Linux distro if we do not just add the bridge manually it is separated in this howto. For the clear and full howto, we would repeat the two first steps just to enable this howto to be independent of the original one mentioned above.
So use full virtualization under Linux you can use QEMU and no other library or manager like virt-manager. QEMU is simple enough and with a couple of parameters to it, you can start KVM virtual machines with near-native performance. To use KVM you must enable it in the BIOS of your server (or desktop machine).

Here are the main steps:

STEP 1) Enable KVM in the BIOS

  • For Intel machine you must find option Intel Virtualization Technology (or Intel VT-x) probably in BIOS menu of Chipset, Advanced CPU Configuration or other.
  • For AMD machine the virtualization cannot be disabled so it is enabled by default, but you can check for additional virtualization features to enable like Virtualization Extensions, Vanderpool and other.
  • Enable also additional features – Intel VT-d or AMD IOMMU, if they are available.

Reboot your machine and check if the KVM is supported:

srv@local ~$ cat /proc/cpuinfo |grep -E "vmx|svm"
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
...

STEP 2) Install QEMU

Under CentOS 7 you can just install couple of packets – that’s all you need:

yum install -y qemu qemu-common qemu-img qemu-kvm-common qemu-system-x86 qemu-user bridge-utils

Or under Ubuntu

apt-get install qemu-kvm bridge-utils

STEP 3) Prepare the network 1 – the bridge device

Under CentOS 7 add the following configuration file

/etc/sysconfig/network-scripts/ifcfg-br0

with the content of

DEVICE=br0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
IPADDR0=192.168.0.1
PREFIX0=24
#GATEWAY0=192.168.0.1
NETMASK=255.255.255.0
IPV6_FAILURE_FATAL=no
NM_CONTROLLED=no
ZONE=public

If you want to use a real IP set to your virtual machine, you should set a real IP here and uncomment the GATEWAY0 with the real gateway IP. If real IP is used then you should include the main Internet network interface to the bridge by adding at the end of the configuration file /etc/sysconfig/network-scripts/ifcfg-eth0 (if eth0 is your network interface):

...
BRIDGE=br0

And restart the network

srv@local ~$ systemctl restart network

Under Ubuntu add to the file

/etc/network/interfaces

the following:

# Bridge
auto br0
iface br0 inet static
  address 192.168.0.10
  netmask 255.255.255.0
#  gateway 192.168.0.1
  bridge_ports none
  bridge_stp off
  bridge_fd 0
  bridge_maxwait 0

If you want to use real IP set to your virtual machine, you should set a real IP here and uncomment the GATEWAY0 with the real gateway IP and replace the “none” in the option “bridge_ports” with the name of your main Internet network interface. For example:

  ...
  bridge_ports eth0
  ...

And restart the network

srv@local ~$ /etc/init.d/networking restart

Or we can add the bridge device manually:

srv@local ~$ brctl addbr br0
srv@local ~$ ip link set dev br0 up
srv@local ~$ ip addr add 192.168.0.1/24 dev br0

If we use real IP we have to add the main Internet network interface to the bridge, so when you set up the network in our virtual machine with a real IP it will work with no more additional configurations, but if we use a local IPs like our setup here and we want to have Internet in our virtual machine we must enable masquerade and linux routing. You can do it with:

srv@local ~$ echo 1 > /proc/sys/net/ipv4/ip_forward
#NAT with firewalld
srv@local ~$ firewall-cmd --add-masquerade --permanent
#NAT with iptables
srv@local ~$ iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE

Use either firewalld or iptables setup, depends on your system configuration, just check if firewalld is running with:

srv@local ~$ firewall-cmd --list-all

If you receive an error, saying command not found or firewalld is not running, you should use the “NAT with iptables”
So the network is ready!

STEP 4) Prepare the network 2 – the tun/tap for the virtual machine

After we have added a bridge device tun/tap device, which will be used for the QEMU virtual machine must be added:

srv@local ~$ ip tuntap add tap0 mode tap
srv@local ~$ brctl addif br0 tap0

STEP 5) Create a QEMU hard drive

Create a 100G file

srv@local ~$ cd /mnt/storage1/disks/
srv@local ~$ qemu-img create -f qcow2 vm_harddisk.qcow2 100G
Formatting 'vm_harddisk.qcow2', fmt=qcow2 size=107374182400 encryption=off cluster_size=65536 lazy_refcounts=off 

or you can enable encryption (but on every start of your virtual machine you must set the key through the qemu console to start the virtual machine):

srv@local ~$ qemu-img create -f qcow2 vm_harddisk_e.bin -o encryption 100G
Formatting 'vm_harddisk_e.bin', fmt=qcow2 size=107374182400 encryption=on cluster_size=65536 lazy_refcounts=off

STEP 6) Boot up the QEMU KVM virtual server

srv@local ~$ qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -runas qemu -daemonize -vnc 127.0.0.1:1 \
-drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio \
-boot d -net nic,model=virtio,macaddr=00:00:00:00:00:01 -net tap,ifname=tap0 \
-balloon virtio -m 2048 -monitor telnet:127.0.0.1:5801,server,nowait

The command above will :

  • “-enable-kvm” – enable the KVM – full virtualization with near native performance
  • “-cpu host” – will expose all supported host CPU features (only supported in KVM mode)
  • “-smp 4” – sets 4 processors to the virtual machine
  • “-daemonize” – start the command in daemon mode
  • “-runas qemu” – run under user, you can run thwo whole virtual machine from a user created especially for it, no need to run it with root, even it is recommended to run it under unprivileged user
  • “-vnc 192.168.1.10:1” – start a VNC server on this IP:PORT = 192.168.1.10:5901, the IP must present on the server or you can use 0.0.0.0:1 for 0.0.0.0:5901, but in every situation limit the access by a firewall
  • “-drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio” – set the main hard drive of the system
  • “-boot d” – boot from the first hard drive
  • “-net nic,model=virtio,macaddr=00:00:00:00:00:01 -net tap,ifname=tap0” – set the network interface using the tap device created by STEP 3) and STEP 4)
  • “-balloon virtio” – use balloon driver to be able to hot add or hot remove RAM (newer version this option is depricated and it can be skipped)
  • “-m 2048” – set virtual RAM size to megs
  • “-monitor telnet:127.0.0.1:5801,server,nowait” – set the management console for the this virtual server, you can connect with:
    srv@local ~$ telnet 127.0.0.1 5801
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
    Escape character is '^]'.
    QEMU 2.0.0 monitor - type 'help' for more information
    (qemu) 
    <Press "CTRL+]">
    telnet> Connection closed.
    

    When quitting the management console you must NOT exit the console with quite/exit or CTRL+d, becuause it will terminate the virtual server, you must disconnect from the console with “CTRL+]” and then quit the telnet shell. With the console you can hot add/remove CPU, RAM, network cards, pci devices, harddrives, start/stop/shutdown/reset the virtual machine and a lot more.

Boot the virtual machine from the hard drive given by “-drive” with network “-net” (couple of options), the RAM uses baloon memory and could be adjusted on-the-fly and sets the vncserver to listen for connection on port IP:port = 192.168.1.1:5901 (probably you’ll want to change this with a the real IP of your server, but be careful to set up a firewall rule for 5901 – the vnc port) and a management console listening on IP:port 127.0.0.1:5801.

* Boot the virtual server from a virtual CD/DVD

Probably the first time booting you might need to boot from an installation disk, this could be done by the following command:

srv@local ~$ qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -runas qemu -daemonize -vnc 127.0.0.1:1 -cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso -boot c -drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio -net nic,model=virtio,macaddr=00:00:00:00:00:01 -net tap,ifname=tap0 -balloon virtio -m 2048 -monitor telnet:127.0.0.1:5805,server,nowait

The changes:

  1. “-boot c” – First boot device is now CD/DVD. “c” is for CD, “d” is for disk
  2. “-cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso” – added the installation disk to the virtual machine

A newer QEMU version may need adding “script=no,downscript=no” to the tap0 interface!

srv@local ~$ qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -runas qemu -daemonize -vnc 127.0.0.1:1 -cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso -boot c -drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio -net nic,model=virtio,macaddr=00:00:00:00:00:01 -net tap,ifname=tap0,script=no,downscript=no -m 2048 -monitor telnet:127.0.0.1:5805,server,nowait

Howto do QEMU full virtualization with MacVTap networking

To use full virtualization under linux you can use QEMU and no other library or manager like virt-manager. QEMU is simple enough and with couple of parameters to it you can start KVM virtual machines with near native performance. To use KVM you must enable it in the BIOS of your server (or desktop machine).

Here a several simple step to start a KVM virtual server:

STEP 1) Enable KVM in the BIOS

  • For Intel machine you must find option Intel Virtualization Technology (or Intel VT-x) probably in BIOS menu of Chipset, Advanced CPU Configuration or other.
  • For AMD machine the virtualization cannot be disabled so it is enabled by default, but you can check for additional virtualization features to enable like Virtualization Extensions, Vanderpool and other.
  • Enable also additional features – Intel VT-d or AMD IOMMU, if they are available.

Reboot your machine and check if the KVM is supported:

srv@local ~$ cat /proc/cpuinfo |grep -E "vmx|svm"
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
...

STEP 2) Install QEMU

Under CentOS 7 you can just install couple of packets – that’s all you need:

yum install -y qemu qemu-common qemu-img qemu-kvm-common qemu-system-x86 qemu-user bridge-utils

Or under Ubuntu

apt-get install qemu-kvm bridge-utils

STEP 3) Prepare the network

srv@local ~$ ip link add link enp8s0f1 name macvtap0 type macvtap mode bridge
srv@local ~$ ip link set macvtap0 up

Here we create a macvtap0 device in bridge mode, these commands will create a tap device bridged to the network interface “enp8s0f1” (in our case, you must replace this device name with the device name you want to bridge your virtual machine network, probably the main interface of your server/desktop machine?). Only these two commands are needed, no other devices or network reload is needed.
The device will show in “ip addr”

7: macvtap0@enp8s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether 2e:51:7e:bb:44:ee brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2c51:7eff:febb:44ee/64 scope link 
       valid_lft forever preferred_lft forever

This setup could expose the MAC address of the macvtap device to the router port connected

STEP 4) Create a QEMU hard drive

Create a 100G file

srv@local ~$ cd /mnt/storage1/disks/
srv@local ~$ qemu-img create -f qcow2 vm_harddisk.qcow2 100G
Formatting 'vm_harddisk.qcow2', fmt=qcow2 size=107374182400 encryption=off cluster_size=65536 lazy_refcounts=off 

or you can enable encryption (but on every start of your virtual machine you must set the key through the qemu console to start the virtual machine):

srv@local ~$ qemu-img create -f qcow2 vm_harddisk_e.bin -o encryption 100G
Formatting 'vm_harddisk_e.bin', fmt=qcow2 size=107374182400 encryption=on cluster_size=65536 lazy_refcounts=off

STEP 5) Boot up the QEMU KVM virtual server

srv@local ~$ qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -runas qemu -daemonize -vnc 127.0.0.1:1 \
-drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio \
-boot d -net nic,model=virtio,macaddr=$(cat /sys/class/net/macvtap0/address) \
-net tap,fd=3 3<>/dev/tap$(cat /sys/class/net/macvtap0/ifindex) \
-balloon virtio -m 2048 -monitor telnet:127.0.0.1:5801,server,nowait

The command above will :

  • “-enable-kvm” – enable the KVM – full virtualization with near native performance
  • “-cpu host” – will expose all supported host CPU features (only supported in KVM mode)
  • “-smp 4” – sets 4 processors to the virtual machine
  • “-daemonize” – start the command in daemon mode
  • “-runas qemu” – run under user, you can run thwo whole virtual machine from a user created especially for it, no need to run it with root, even it is recommended to run it under unprivileged user
  • “-vnc 192.168.1.10:1” – start a VNC server on this IP:PORT = 192.168.1.10:5901, the IP must present on the server or you can use 0.0.0.0:1 for 0.0.0.0:5901, but in every situation limit the access by a firewall
  • “-drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio” – set the main hard drive of the system
  • “-boot d” – boot from the first hard drive
  • “-net nic,model=virtio,macaddr=$(cat /sys/class/net/macvtap0/address) -net tap,fd=3 3<>/dev/tap$(cat /sys/class/net/macvtap0/ifindex)” – set the network interface using the tap device created by macvtap0 device (STEP 3)
  • “-balloon virtio” – use balloon driver to be able to hot add or hot remove RAM
  • “-m 2048” – set virtual RAM size to megs
  • “-monitor telnet:127.0.0.1:5801,server,nowait” – set the management console for the this virtual server, you can connect with:
    srv@local ~$ telnet 127.0.0.1 5801
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
    Escape character is '^]'.
    QEMU 2.0.0 monitor - type 'help' for more information
    (qemu) 
    <Press "CTRL+]">
    telnet> Connection closed.
    

    When quitting the management console you must NOT exit the console with quite/exit or CTRL+d, becuause it will terminate the virtual server, you must disconnect from the console with “CTRL+]” and then quit the telnet shell. With the console you can hot add/remove CPU, RAM, network cards, pci devices, harddrives, start/stop/shutdown/reset the virtual machine and a lot more.

Boot the virtual machine from the hard drive given by “-drive” with network “-net” (couple of options), the RAM uses baloon memory and could be adjusted on-the-fly and sets the vncserver to listen for connection on port IP:port = 192.168.1.1:5901 (probably you’ll want to change this with a the real IP of your server, but be careful to set up a firewall rule for 5901 – the vnc port) and a management console listening on IP:port 127.0.0.1:5801.

* Boot the virtual server from a virtual CD/DVD

Probably the first time booting you might need to boot from an installation disk, this could be done by the following command:

srv@local ~$ qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -runas qemu -daemonize -vnc 127.0.0.1:1 -cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso -boot c -drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio -net nic,model=virtio,macaddr=$(cat /sys/class/net/macvtap0/address) -net tap,fd=3 3<>/dev/tap$(cat /sys/class/net/macvtap0/ifindex) -balloon virtio -m 2048 -monitor telnet:127.0.0.1:5801,server,nowait

The changes:

  1. “-boot c” – First boot device is now CD/DVD. “c” is for CD, “d” is for disk
  2. “-cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso” – added the installation disk to the virtual machine