# Solidworks Standalone in a VM

# Virtualbox

Solidworks with education licenses doesn't like VirtualBox. I get the error `using a standalone license for solidworks is not supported in this virtual environment`. Since I exclusively run Arch as my daily driver, this is a bummer.

Turns out you have to trick windows into thinking it isn't running in a VM. Found this [bash script](https://gist.github.com/W-Floyd/7ccf5e4f074939e403bed483f82a4042) so I'm cloning it here for posterity.

```bash
nano bash.sh
```

past and save this, change `__my_vm='W10'` to the name of the VM you're working on

```bash
#!/bin/bash

__get_random_string () {

    openssl rand -hex "${1}" | cut -c "1-${1}"

}

__my_vm='W10'

VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "American Megatrends Inc"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "2.1.0"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "ASUSTek Computer"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "$(__get_random_string 9)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "$(__get_random_string 20)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "$(__get_random_string 8)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "SEAGATE ST3750525AS"

exit
```

```bash
chmod +x bash.sh
```

```bash
./bash.sh
```

# QEMU

First, you will need to set a CPU type in virt-manager. The default QEMU virtual CPU cannot have its hypervisor flag removed within libvirt.

For best performance and functionality, you should just select "Copy host CPU configuration" and "Apply". This will allow you to use nested virtualization, running 64-bit accelerated virtual machines inside this virtual machine.

next

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682482235494/cef0adfa-0440-4bf5-b975-22149f0660c2.png align="center")

under CPU in the XML add:

```plaintext
<feature policy='disable' name='hypervisor'/>
```

next,

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682482390849/4d2f54f7-0304-4374-8ab0-0350ac317011.png align="center")

add

```plaintext
 <kvm>
    <hidden state='on'/>
  </kvm>
```

into the features section

Windows now thinks its a *real* boy. Yay.
