12

The question is not around Solidworks actually, so please continue to read.

The whole idea of virtualization is to be hardware independent. Before our eyes a whole new dependency level is being created - affixment to the hypervisor.

As far as I know searching in a way to find a workaround of this problem is not violation of the Solidworks license and local law in my country.

My client and I want to activate Solidworks Products on KVM virtual machine. For some weird reasons (Hyper-V and VMware are supposed to be well tested :) they (developers) of Solidworks 2015 PDM don't want their products to be activated (last 2014 version worked just fine) on Qemu-KVM.

http://www.solidworks.com/sw/support/11168_ENU_HTML.htm http://www.solidworks.com/sw/support/11168_ENU_HTML.htm

I am using:

setup

As you can see it's KVM-based VM with Windows 2012 and Solidworks PDM installation.

Question: What else can they check if I am running my VM in Qemu-KVM besides checking:

  • MAC address(es) of VM's Ethernet adapter,
  • Device driver labels,
  • CPU model,
  • ACPI tables.

I am going to rule out the above mentioned things in next few hours, but I'd like to know if You have any other ideas.

Solution:

It turns out they validate two things:

  1. As Michael Hampton correctly pointed there's -cpu,kvm=off option

to disable the CPUID 0x40000000 leaf.

  1. ACPI Tables on the guest.

Relevant parts of qemu command line parameters:

-cpu host,kvm=off -smbios type=0,vendor=LENOVO,version=FBKTB4AUS,date=07/01/2015,release=1.180 -smbios type=1,manufacturer=LENOVO,product=30AH001GPB,version=ThinkStation P300,serial=S4M88119,uuid=cecf333d-6603-e511-97d5-6c0b843f98ba,sku=LENOVO_MT_30AH,family=P300

Libvirtd config file syntax:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
# Please notice there is xmlns definition in <domain> tag. Without it 
# <qemu:commandline> and <qemu:arg> tags won't work.
  <name>acm-server</name>
  <uuid>d0e14081-b4a0-23b5-ae39-110a686b0e55</uuid>
  <memory unit='KiB'>81920000</memory>
  <currentMemory unit='KiB'>81920000</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.1'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
# Please notice there is no CPU definition on the top.
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,kvm=off'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=0,vendor=LENOVO,version=FBKTB4AUS,date=07/01/2015,release=1.180'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=1,manufacturer=LENOVO,product=30AH001GPB,version=ThinkStation P300,serial=S4M88119,uuid=cecf333d-6603-e511-97d5-6c0b843f98ba,sku=LENOVO_MT_30AH,family=P3'/>
  </qemu:commandline>
</domain>

As a proof, now it wants to activate: with hack

Update 21.04.2017r. DS Justice mentioned that Qemu (I used virtio in this example) disk mode may be relevant as well.

  • This site is for professional sysadmins who are inherently interested in support/supportable solutions, we really try very hard to work 'within the lines'. – Chopper3 Oct 7 '15 at 17:22
  • 7
    As long as something is not standard solution doesn't mean that is unsupportable, as you can see it is. Don't you really see the problem here? They force someone to choose commercial tools and hide behind - because it's well tested. It's a nonsense when it comes to choosing of hypervisor. For underlaying OS - yes, but not for an application. – Michal Sokolowski Oct 7 '15 at 17:40
  • If enough paying customers post a demand for SolidWorks to support KVM, they will be forced to. This already happened when Oracle released OEL and tried to block installation on RHEL, just a matter of pressure and the potential of taking your business elsewhere. – dyasny Oct 8 '15 at 13:59
  • They already did. They support it, for example they had task to install the license today. – Michal Sokolowski Oct 8 '15 at 15:06
  • 1
    This didn't work for me with a virtual IDE boot disk, presumably because of the AHCI disk description containing the word "QEMU". Changed my boot disk to be VirtIO as shown in your screenshot, and I'm golden. Thanks! – DS Justice Apr 11 '17 at 1:22
12

Most current hypervisors that run on Intel hardware use CPUID leaves 0x40000000 et seq. to pass information about the hypervisor from host to guest.

KVM, Xen, VMware and Hyper-V all use this method.

This is in addition to the hypervisor feature flag set in CPUID leaf 0x1, which indicates that the machine is a virtual machine.

It's therefore trivial for a program which can call the CPUID instruction to determine whether it is running under one of these hypervisors.

Recent versions of KVM include a command line option to disable the CPUID 0x40000000 leaf, -cpu kvm=off.

  • 1
    And this method already proved effective against NVIDIA drivers blocking KVM VMs on passthrough as well. – dyasny Oct 8 '15 at 13:58
5

The official way of activating Solidworks server on KVM is to apply for a "Activation Exempt licensing for SolidWorks". We do this through the reseller, but possibly could be done directly through Solidworks support.

Solidworks sends a license file that Solidworks License Manager loads through the Advanced Options of the Server Administration tab.

Given that the last two years it has taken more than 2 weeks for Solidworks to send the license file, it would be nice to have them not blacklist KVM.

Solidworks has an "Enhancement Request" open with the title: "Provide SNL Server support for VM KVM Qemu Libvirt." ER # 1-9482749288 I found it by logging in to Solidworks portal, finding the Enhancement Request link, and typing KVM.

Please leave a comment on this Enhancement Request! Hopefully they'll decide KVM is a legitimate virtualization environment.

  • AWS is using KVM! – FreeSoftwareServers Nov 30 '18 at 7:47
  • 1
    @FreeSoftwareServers AWS has only recently switched to KVM for some machine types. There's still a LOT of Xen out there. – Michael Hampton Nov 30 '18 at 12:46
  • True, just saying it IS a legitimate virtualization environment. – FreeSoftwareServers Nov 30 '18 at 20:12
  • Don't tell it to me, tell it to Solidworks! :) – lickdragon Dec 3 '18 at 15:40
5

I just wanted to share my experience here as well, in case others are in a similar situation (trying to install solidworks on a virtualbox VM)

My attempted setup:

xubuntu 16.04 host OS, VirtualBox, Windows 10, and Solidworks 2015. I was seeing the same error discussed above.

The Solution:

The solution I eventually found was to use the hidevm.bat script included in the Solidsquad crack, for tricking Solidworks into thinking it isn't running in a VM. you can use the .bat file even if you have a legitimate license (as I would hope you do). the .bat is intended for users running Solidworks inside a VirtualBox VM, with Windows as the host OS as well, however if you're like me trying to run Linux as the host OS, you can still open up the .bat file, pick out the relevant commands, adjust them for linux, and run them. the modified relevant commands are:

VMNAME=[whatever your VM name is]
rand9="abcdefghi" #any 9 character string
rand20="abdcefghijklmnopqrst" #any 20 character string
rand8="abcdefgh" #any 8 character string

VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "American Megatrends Inc"
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "2.1.0"
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "ASUSTek Computer"

VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" $rand9

VBoxManage setextradata $VMNAME "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" $rand20

VBoxManage setextradata $VMNAME "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" $rand8
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "SEAGATE ST3750525AS"

In case your VM is configured to use EFI firmware you need to replace pcbios by efi in the keys. See 9.12. Configuring the BIOS DMI information.

  • This failed for me. May be because my system is with UEFI. – kyb Apr 7 '17 at 11:40
  • But I found solution in VBox docs $9.12. > In case your VM is configured to use EFI firmware you need to replace pcbios by efi in the keys. I suggest to edit message. – kyb Apr 7 '17 at 12:34
4

'/> missing on EOL <qemu:arg value='type=1,manufacturer=LENOVO so here is the complete libvirt config modifications :

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
 (...)

... Please notice there is no CPU definition on the top.
   <qemu:commandline>
     <qemu:arg value='-cpu'/>
     <qemu:arg value='host,kvm=off'/>
     <qemu:arg value='-smbios'/>
     <qemu:arg value='type=0,vendor=LENOVO,version=FBKTB4AUS,date=07/01/2015,release=1.180'/>
     <qemu:arg value='-smbios'/>
     <qemu:arg value='type=1,manufacturer=LENOVO,product=30AH001GPB,version=ThinkStation P300,serial=S4M88119,uuid=cecf333d-6603-e511-97d5-6c0b843f98ba,sku=LENOVO_MT_30AH,family=P3'/>
   </qemu:commandline>
 (...)
  • Thank you for your answer, it helped me make mine, I just removed unnecessary code. – FreeSoftwareServers Oct 11 at 4:47
1

I figured i'd share my method which worked to hide VM from Windows/Task MGR (It's also got less needless stuff and is easier to read). I was not trying to activate Solidworks but IMO this thread is more about hiding your running in a VM and maybe should be edited as such. Anyway...

Add the following to your domain.xml and make sure to completley remove the CPU Section

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
#Regaular Stuff
#No CPU Type Set
 <features>
    <acpi/>
    <apic/>
    <kvm>
      <hidden state='on'/>
    </kvm>
    <vmport state='off'/>
  </features>
#Add to Bottom of Domain.xml
  </devices>
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,hv_time,kvm=off,hv_vendor_id=null,-hypervisor'/>
  </qemu:commandline>
</domain>

Turn VM off and back on and test!

  • 1
    I got SolidWorks working on qemu on Ubuntu 19.04 with this configuration, the smbios arguments and VirtIO as the driver for both disks and ethernet. – Avamander Oct 7 at 9:06
  • 1
    @Avamander That's awesome, as I said I wasn't even working with SolidWorks but looks like I helped solve OP's question! I forget what I was working on, but this got it to work for me as well for something else, I think it was gaming related, wouldn't run game in a VM. My VM's are more powerful then most peoples gaming laptops :P – FreeSoftwareServers Oct 11 at 4:49
  • @Avamander I'm just curious, did you try without the smbios arguments? – FreeSoftwareServers Oct 11 at 23:51
  • I did not try without a forged smbios. – Avamander Oct 13 at 20:07

protected by Community May 23 '17 at 23:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.