How to install Windows 10 on an expansion card

This is how I managed to install Windows 10 on my 250gb expansion card whilst having Manjaro installed on my SSD. I can boot into Windows by inserting the expansion card into my laptop and booting it.

Create a windows 10 USB bootable disk and boot from it. (You can use WoeUSB on Linux or Rufus on Windows)

Once you’re in the Setup program, select your language, time and currency format and input method, and click Next. Click the Install Now button. Enter/Skip your Windows key if prompted, and read and accept the software licence. In the next screen, press “SHIFT+F10” to open command prompt.

Partitioning

diskpart

list disk

select disk x (where x is your disk number 0,1,2,3,… and so on)

clean

(This will format the whole disk)

convert gpt

create partition primary size=500

format quick fs=ntfs label=“Windows RE Tools”

assign letter=“T”

set id=“de94bba4-06d1-4d40-a16a-bfd50179d6ac”

gpt attributes=0x8000000000000001

create partition efi size=100

format quick fs=fat32 label=“System”

assign letter=“S”

create partition msr size=128

create partition primary size=230000 (this is the size of your main Windows partition"

format quick fs=ntfs label=“Windows”

assign letter=“W”

create partition primary size=4096

format quick fs=ntfs label=“Recovery Image”

assign letter=“R”

set id=“de94bba4-06d1-4d40-a16a-bfd50179d6ac”

gpt attributes=0x8000000000000001

list volume

exit

Installing

Type C: and press enter.
Type Dir to check if it’s your Windows 10 bootable pendrive. If not, use diskpart to verify your USB drive volume letter. list volume command in the above script shows the drive letter of your USB drive. (In my case I did not use C: but instead either X: or H: I think.) This should be whatever USB drive has the Windows installer on it)

Now, type the following command in sequence:

md R:\RecoveryImage

copy C:\sources\install.wim R:\RecoveryImage\install.wim

cd X:\Windows\System32

dism /Apply-Image /ImageFile:R:\RecoveryImage\install.wim /Index:1 /ApplyDir:W:\

md T:\Recovery\WindowsRE

copy W:\Windows\System32\Recovery\winre.wim T:\Recovery\WindowsRE\winre.wim

bcdboot W:\Windows /s S: /f UEFI

W:\Windows\System32\reagentc /setosimage /path R:\RecoveryImage /target W:\Windows /index 1

W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows

Updating to Windows 11

Once you have Windows 10 working, you can upgrade to Windows 11 by downloading the Installation Assistant from Download Windows 11

Source:

Some changes had to be made as noted in the comments

10 Likes

why do people keep referring to command line hacks while you can do it legit using a Windows-to-go installer

1 Like

How do you get and use the Windows to go installer?

I am not aware of any windows-to-go installer that can run on GNU/Linux. That is part of the reason, I didn’t have an existing Windows install to run Rufus on.

1 Like

As helpful (and unhelpful) Microsoft Docs provide;

Oh, and if you are wondering, you seem to need a Windows 10 Enterprise for that.
Yeah. I don’t like it when they … I mean, I’m already Win 10 Pro, which give me Hyper-V

1 Like

Same here, check the size of you file beforehand! Safes alot of time

1 Like

I’ve been trying to follow these instructions for hours. I cannot see the install.wim files in DOS at all. It won’t let me copy the file because of this. I’d guess that it has to do with the format of the boot drive from the official ISO file, which incidentally is 21H2.

Anyone else figure this out already? I’m going to try doing this all within Linux using a set of wim tools I discovered, fingers crossed. But seriously, the prices absolutely stops at the point where cutting the install.wim happens.

Thanks in advance for any pointers to what I’m doing incorrectly.

Edit:
I figured it out after finding the other thread on doing this. Never mind!

One update though: I had to make the “R” drive 6GB in order to transfer the wim file.

You can’t find the INSTALL.WIM file? Did you try INSTALL.ESD

It definitely shows up in Linux. It is install.wim, not .esd in the case of the ISO I downloaded from Microsoft yesterday.

Anyway, it’s right at about 5GB, so I figured it must have something to do with the position formatting on the bootable USB stick not displaying file sizes over some number.

I just set up the R drive at 6 gigs, then went back into Linux to copy the wim file to the windows position, and then cut it from there to the “R” drive after reassigning drive letters in DOS.

If you’re on windows and have a USB-C port, you can always use rufus to create a windows-to-go installation straight to the expansion card! This doesn’t require enterprise unlike the official way. :blush:

How to create a windows-to-go solution with rufus: A guide.

First, download rufus.
Go to this webpage, scroll down and click Rufus 3.x

Which one do i choose?

  • Portable → You don’t have to install, instantly works on any 64bit system
  • Normal → Installs straight to your pc, always having an icon in the search tab.

Secondly, install rufus
Look in your downloads folder for an application with the name rufus, double click it.
image

An ‘execute as administrator’ window should pop up, click yes. → Input your password administrator’s password if you’re a normal user.
image

You should have a grey window with a few options.
image

Plug in your drive

I don't have an ISO yet.

If you don’t have an ISO ready, you can download it via rufus. Otherwise you can skip this part! :blush:

Click on the little arrow, a selection window should pop up, click download, then click the button again once the window disappears.
image

Select the windows version you want, in this case Windows 10 21H2 build 19044 revision 1288
image
(Keep clicking continue until you get to this part)

Select the download location of your ISO, in this case c:/users/yourname/downloads

Wait for rufus to download your ISO, this can take a while depending on your ISP.
image

End of the downloading ISO part Continue to next part.

If you do have an ISO, you can continue from here on.

Select your drive which you plugged in before, if you haven’t do that now
image

(Your drive automatically gets formatted by rufus. So watch out that you plugged in the right drive!)

Load the ISO into rufus by clicking select and then selecting the ISO with file explorer. If you downloaded an ISO it should just get loaded in once finished, if not select it from the place you chose to store it.
image

Find your ISO.

Click ‘image option’ inside of rufus, a window pops down giving you the window-to-go option.
image

Now click ‘start’ and select the version you want to use.
image

In this version (3.20) you can also add a couple of optional add-ons!
image
(This gets prompted after the previous step)

But, what are these?

  • Skip data collection → Turns off inking, advertising ID, … also the log on screen that you get on a fresh window install prompting you for your liver if you aren’t careful enough clicking the right buttons.
  • Prevent windows to go from accessing internal disks → You won’t be able to access hard disks that are hard mounted in the computer, in the case of the FW laptop your m.2 SSD.
  • Copy regional info and local account info-> Use the same keyboard / language as your current account and copy your username and password to the windows-to-go installation
    (This doesn’t work with online accounts eg. your Microsoft account)

I recommend these settings, although you might want to turn off accessing local disk. I just turn it on so I can use and see the steam library / files on my linux install. Could also be handy if your computer hard crashes and you end up in an unrecoverable state to format your disks like you would do in a linux live enviroment.
image

Click on ‘OK’ if you’re absolutely sure about formatting the drive to put windows-to-go on it.
image

Now you’re absolutely done, sit back and relax while rufus formats and applies the windows image to your drive! :blush:
image

Forgot to mention, if you’re on linux you can just do this in a VM by bridging your USB drive to windows. (This is in gnome-boxes)

Would be cool if the people at Balena could add this to their Etcher software, or a linux port of rufus could be achieved! :blush: