1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Migrating (+etc) Win10 virtualbox VM to vmware

Last updated at Posted at 2022-06-03

Preamble

  • as virtualbox Windows10 guest does not support WSL2, I had to migrate to vmware.
    • it seems that the license is about to be changed to subscription, so I had to buy it before vmware 17 is out.
  • just a memorandum.

Installing vmware

Compiling kernel modules

sudo CPATH=/usr/src/linux-headers-$(uname -r|sed s/amd64/common/)/include/linux vmware-modconfig --console --install-all

acknowledgement: https://redtm.com/blog/vmware-workstation-on-kernel-5.16.0-1debian-testing/

If it even does not work, use https://github.com/mkubecek/vmware-host-modules/

Migrate VM

  • on virtualbox, "File -> Export Appliance"
  • on vmware, open the ova.
    • Hardware -> Processors -> Virtualize VT-x and IOMMU
    • Options -> General -> Guest Operating System -> Microsoft Windows

Start Windows

  • Here Windows could be unstable for a while. Remove virtualbox guest addition as soon as possible and install vmware tools. Then shutdown.

Configure VM

Configure ethernet

  • add ethernet0.virtualDev = "vmxnet3" to vmx conf
  • "Custom: Specific virtual network", input /dev/vmnet8
  • check /etc/vmware/vmnet8/nat/nat.conf ip and netmask. start windows again and configure NIC's IP to that.

Configure Display

  • Accelerate 3D, video memory 128GB(?)
    • Without this, your VM will freeze so often...

should not need so much video memory after disabling memory page trimming

Configure CPU

  • If somehow your VM is slow, set CPU "Number of processors: 2, Number of cores per processor: 2". Because somehow Number of processors is not recognized properly here...

Disable Drag-and-Drop and Copy-paste

  • Seems they cause freeze...
  • (from options -> guest isolation)

Disable memory page trimming

  • (from options -> advanced)

acknowledgement: https://qwerty.work/blog/2015/03/vmwarefreeze.php#toc0

Convert to WSL2

  • Install (WSL and) virtualization platform components.
#Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux # Should be already there right?
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform
  • Convert by wsl --set-version Debian 2

Note that from now on this wsl will not boot on virtualbox :(

Optionally set this to %USERPROFILE%.wslconfig (of course double-check about memory size)

[wsl2]
memory=8GB
swap=0

exclude Windows PATH by /etc/wsl.conf

[interop]
appendWindowsPath=false

Convert from MBR to GPT

(Do not perform this if you are booting UEFI or your disk is already GPT)

  • Prepare Windows ISO media and GParted ISO. Note that Windows installation does not work during rebuilding boot record.
  • Boot from GParted ISO, move the Windows partition to the right about 300MB.
    • If you cannot, you have to Expand Disk in VM settings.
  • Boot from Windows ISO media, Troubleshoot -> Advanced options -> Command Prompt.
bootrec /fixmbr
bootrec /rebuildbcd
# here you could see strange drive letter but seems you can proceed.
  • Boot Windows, run command prompt as admin
mbr2gpt /convert /allowFullOS
  • VM setting -> Options -> Advanced -> Firmware type -> UEFI

  • Optionally, you can reextend EFI partition. Unfortunately gparted cannot extend fat32 volumes, but temporarily you can use EaseUS Partition Master free.

Upgrade to Win11

  • Before beginning this phase, do backup your machine. You cannot go back.
    • Also (sadly) this is the final state that you can backup your machine.
  • We need to install TPM. We should already be using UEFI, so all we have to do is to encrypt the disk (on Linux, managedvm.autoAddVTPM = "software" does not work).
  • Then download Windows 11 Installation Assistant from https://www.microsoft.com/software-download/windows11 and proceed.

Installing WSA

This does not work here somehow, so I don't recommend...

Recognize as SSD

(admin)

Set-PhysicalDisk -FriendlyName "Vmware Virtual SATA Hard Drive" -MediaType SSD

acknowledgement: https://superuser.com/questions/1634106/in-a-virtual-machine-with-ssd-solid-state-hard-drive-how-can-create-a-hdd-hard/1634148#1634148

Install WSA

Somehow Amazon Appstore is still grayed out...

  1. open ttps://store.rg-adguard.net/
  2. "ProductID", 9P3395VX91NR, "Slow"
  3. Look for MicrosoftCorpolationII.WindowsSubsystemForAndroid.Msixbundle
  4. Add-AppPackage -Path ...Msixbundle as admin

Install docker

X11

Somehow WSLg is too slow, so perhaps mobaxterm is better...

.wslconfig

[wsl2]
guiApplications=false

.profile

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0
echo SYSTEM_DISPLAY=$DISPLAY | tee -a conf # if some system app use it in background

License

Bought in yahoo store. Hope it is not pirated (lol)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?