Skip to contentSkip to conversation

Installing Windows Server 2019 from a remotely mounted ISO

DISCUSSION Alexander Amelkin 7 participants 14 messages May 25, 2020 – Oct 18, 2022 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi all!

We're trying to install Windows Server 2019 from an ISO image mounted as remote media via OpenBMC WebUI.

The Windows installer boots, but then says that a media driver is missing.

Are there any hints on how to accomplish the task?

Attached is the screenshot of the message we get with Windows Server 2019.

With best regards,
Alexander.

P.S. We're using Intel-BMC version of OpenBMC for the task, but it looks like the remote media part is more or less the same.

#1 lore raw

Hi Alexander, I am also facing the same issue. Did you find any workaround for this ?

Quoted 18 lines · Alexander Amelkin

Hi all!

We're trying to install Windows Server 2019 from an ISO image mounted as remote media via OpenBMC WebUI.

The Windows installer boots, but then says that a media driver is missing.

Are there any hints on how to accomplish the task?

Attached is the screenshot of the message we get with Windows Server 2019.

With best regards,
Alexander.

P.S. We're using Intel-BMC version of OpenBMC for the task, but it looks like the remote media part is more or less the same.

#2 lore raw

Mounting DVD-based ISOs in Intel-BMC Virtual Media is not supported by underlying USB Mass Storage gadget. To mount such iso files they need to be converted to MBR/FAT32 image. Attached instruction shows two ways of preparing such image.

Quoted 18 lines · Thaj

Hi Alexander, I am also facing the same issue. Did you find any workaround for this ?

On Mon, May 25, 2020 at 4:04 PM Alexander Amelkin <[email protected] <mailto:[email protected]>> wrote:

Hi all!

We're trying to install Windows Server 2019 from an ISO image mounted as
remote media via OpenBMC WebUI.

The Windows installer boots, but then says that a media driver is missing.

Are there any hints on how to accomplish the task?

Attached is the screenshot of the message we get with Windows Server 2019.

Quoted 7 lines

With best regards,
Alexander.

P.S. We're using Intel-BMC version of OpenBMC for the task, but it looks
like the remote media part is more or less the same.

# Mouting Windows ISO image in OpenBMC VirtualMedia

OpenBMC implementation of VirtualMedia functionality is based on open source
[Mass Storage Gadget](https://www.kernel.org/doc/html/latest/usb/mass-storage.html).
It has known limitation of no support for DVD ISO images.

By design VirtualMedia will mount all served images as USB Mass Storage device for compatibility. While this doesn't affect modern ISO images for Linux distributions, Windows installer is sensitive to the medium it's booted from.

To verify if ISO you're trying to mount is a CD/DVD image execute following command:

```bash
file <path to iso>
# CD/DVD image will report 'ISO 9660 CD-ROM`
# Mass Storage compatible ISO will usually report 'DOS/MBR'
```

## Windows installation in OpenBMC VirtualMedia Windows ISO images are meant to be mounted in following ways:
- DVD burned directly from ISO
- USB device prepared by Windows Media Creation Tool

None of these are applicable out of the box for OpenBMC VirtualMedia, so following preparation is needed:

### Option 1: Create USB installation disk on Windows and dump drive image

```
Image size consideration

Please note that this method will create image of the whole partition. By default it means that resultant image will have size of your whole USB drive used for the operation (16GB image for 16GB USB drive).

To keep image size as small as possible it's best to use use smallest drive possible (preferably 8GB) for image creation.
Another (more advanced) option is to create/shrink partition on USB drive to preferred size, but keep in mind that it would require rolling back after operation to restore full USB drive capacity.

If you want to have full control over image size and don't want to modify your USB drive, please check 'Option 2', as it covers manual conversion of image without need of any USB device.
```

If Windows Media Creation Tool is not available for your version of Windows,
follow [instructions from Microsoft](https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/install-windows-from-a-usb-flash-drive). In short:
1. Format your USB drive as FAT32 'Active' partition
2. Mount ISO in the system (Windows have built-in support for that)
3. Using linked instruction copy over ISO contents to your USB drive
- copy all files less than 4GB directly
- split sources/install.wim file into multiple .swm files

Dump newly populated FAT32 partition into image. There are various tools to achieve that, you can use following solution based on Cygwin:
1. Install Cygwin from https://cygwin.com/install.html
2. Find your FAT32 partition by executing command:

```bash
cat /proc/partitions
```
   - Find device descriptor for your USB Drive, in this system it has letter ‘D:\’ assigned
```bash
sdb1   D:\
```
3. Create image of the partition with following command,
```bash
dd if=/dev/*** conv=sync,noerror bs=64K status=progress of=***
```
Assuming your drive is at `/dev/sdb1`, and image should be placed at `C:\Users\Admin\Documents\disk_image.img`:
```bash
dd if=/dev/sdb1 conv=sync,noerror bs=64K status=progress of=/cygdrive/c/Users/Admin/Documents/disk_image.img
```

### Option 2: Convert ISO to FAT32 disk image on Linux

```
Following instruction is based on Ubuntu 18.04, but should be applicable
to wide range of modern GNU/Linux operating systems.

It requires wimtools and 7zip, which can be installed as such:
sudo apt install p7zip-full wimtools
```
#### Unpack image to 'iso' directory
```bash
# 7zip package should be available in all modern Linux distributions
7z x <path_to_iso> -oiso
```

#### Create empty image from_iso.img

```bash
# 8 gb should be suitable for double density DVD, but can be decreased to fit the image
dd if=/dev/zero of=from_iso.img count=8 bs=1G
```

#### Create FAT32 partition

```bash
# Interactive tool will require following inputs:
# n <enter> <enter> <enter> <enter> t c w
fdisk from_iso.img
```
```bash
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x84a6bd20.

# type 'n'
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
# type <enter>
Select (default p):

Using default response p.
# type <enter>
Partition number (1-4, default 1):
# type <enter>
First sector (2048-16777215, default 2048):
# type <enter>
Last sector, +sectors or +size{K,M,G,T,P} (2048-16777215, default 16777215):

Created a new partition 1 of type 'Linux' and of size 8 GiB.

# type 't'
Command (m for help): t
Selected partition 1
# type 'c'
Hex code (type L to list all codes): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

# type 'w'
Command (m for help): w
The partition table has been altered.
Syncing disks.
```

#### Format filesystems

```bash
mkfs.vfat from_iso.img
```

#### Modify ISO contents to fit into FAT32 partition

```bash
wimlib-imagex split "./iso/sources/install.wim" "$(pwd)/iso/sources/install.swm" 4000
```
```
WARNING:
Next commands should be performed as 'root' user.
Type 'sudo -s' to switch to root session, type 'exit' afterwards.
```

#### Copy ISO contents to newly created image

```bash
mkdir mounted
mount from_iso.img mounted
rsync -rv --exclude="sources/install.wim" ./iso/ ./mounted
```

#### Unmount devices

```bash
# Ensure that everything has been written to disk
sync
sync
umount mounted
```
#3 lore raw
Quoted 4 lines · Maciej Lawniczak

Mounting DVD-based ISOs in Intel-BMC Virtual Media is not supported by underlying USB Mass Storage gadget. To mount such iso files they need to be converted to MBR/FAT32 image. Attached instruction shows two ways of preparing such image.

Hi Maciej,

Nice write up. Would you be able to contribute this to the openbmc/docs repo?

Signature · 1 line
Patrick Williams

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hi Konstantin,

Quoted 4 lines · Konstantin Klubnichkin

It's about Option 2 (preparing image on Linux). The sequence in the instruction is:
1. Create empty image using dd;
2. Create partition table on it with FAT32 partition;

Quoted 8 lines

3. Format image to FAT32 filesystem;
4. Prepare files from Windows DVD;
5. Mount image to some directory;
6. Copy files to that directory;
7. Unmount image.

I can't get why to create partition table on the image(step 2) if the next step (formatting image with mkfs.vfat, step 3) destroys it?

Looks like a typo, s/image/partition/.

That said, booting windows installer shouldn't be anything special with UEFI, basically you create GPT, EFI System partition on it, put the windows EFI loader there with the right name plus some files it needs, and then copy everything else to NTFS partition.

This should explain it with enough details:

https://techbit.ca/2019/02/creating-a-bootable-windows-10-uefi-usb-drive-using-linux/

HTH

Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 4 lines · Konstantin Klubnichkin

Looks like a typo, s/image/partition/.

I don't think so as formatting partition would require play with losetup and probably some boot loader installation onto the image.

kpartx creates appropriate loop devices automatically, so if your image has a partition table you can easily get the suitable loop devices to run mkfs.vfat on them, then mount it etc.

For UEFI bootloader installation on removable media is just copying a file to a FAT32 partition, nothing fancy.

Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[email protected]
#8 lore raw
In reply to a message not in the archive

Hello Konstantin,

I have several patches [1] to solves mounting DVD-based ISOs through Virtual Media. The published changes is WIP until had approved by the Linux Foundation community, but in the YADRO, we use these changes to support installing the OS Windows via Virtual Media.

I hope your will found it helpful that information to support installing Windows-based OS.

Links:
[1] - https://patchwork.kernel.org/project/linux-usb/list/?series=507583

Quoted 56 lines · Konstantin Klubnichkin

Hello Maciej,
I've got a question regarding the instruction.
It's about Option 2 (preparing image on Linux).
The sequence in the instruction is:
1. Create empty image using dd;
2. Create partition table on it with FAT32 partition;
3. Format image to FAT32 filesystem;
4. Prepare files from Windows DVD;
5. Mount image to some directory;
6. Copy files to that directory;
7. Unmount image.
I can't get why to create partition table on the image(step 2) if the next step (formatting image with mkfs.vfat, step 3) destroys it?
Could you please clarify this point?
Thank you!
22.10.2020, 14:39, "Maciej Lawniczak" <[email protected]>:

Mounting DVD-based ISOs in Intel-BMC Virtual Media is not supported by underlying USB Mass Storage gadget. To mount such iso files they need to be converted to MBR/FAT32 image. Attached instruction shows two ways of preparing such image.

On 10/21/2020 9:32 AM, Thaj wrote:

Hi Alexander, I am also facing the same issue. Did you find any workaround for this ?
On Mon, May 25, 2020 at 4:04 PM Alexander Amelkin <[email protected] <mailto:[email protected]>> wrote:

Hi all!

We're trying to install Windows Server 2019 from an ISO image mounted as remote media via OpenBMC WebUI.

The Windows installer boots, but then says that a media driver is missing.

Are there any hints on how to accomplish the task?

Attached is the screenshot of the message we get with Windows Server 2019.

With best regards,
Alexander.

P.S. We're using Intel-BMC version of OpenBMC for the task, but it looks like the remote media part is more or less the same.

Signature · 6 lines
Best regards,
Konstantin Klubnichkin,
lead firmware engineer,
server hardware R&D group,
Yandex Moscow office.
tel: +7-903-510-33-33
Signature · 3 lines
Best regards,

Igor Kononenko

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 1 line · Konstantin Klubnichkin

Works like a charm with all ISO I had on hands, thank you!

Konstantin,

Please note, I got feedback from some issues about using CDFS images. I work to solve the issue of using such ISO formats.

Signature · 3 lines
Best regards,

Igor Kononenko
#11 lore raw

Hi Igor,

Currently, the remote virtual media emulate the gadget driver as usb thumb drive instead of cd-rom. Please have a look on my patch:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/42986

Thanks,
Troy Lee

-----Original Message-----
From: openbmc <[email protected]> On Behalf Of i.kononenko
Sent: Tuesday, August 3, 2021 11:40 PM
To: Konstantin Klubnichkin <[email protected]>
Cc: [email protected]
Subject: Re: Installing Windows Server 2019 from a remotely mounted ISO

Quoted 1 line · Konstantin Klubnichkin

Works like a charm with all ISO I had on hands, thank you!

Konstantin,

Please note, I got feedback from some issues about using CDFS images. I work to solve the issue of using such ISO formats.

Signature · 3 lines
Best regards,

Igor Kononenko
#12 lore raw

Hello Troy,

Quoted 5 lines · Troy Lee

Hi Igor,

Currently, the remote virtual media emulate the gadget driver as usb thumb drive instead of cd-rom. Please have a look on my patch:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/42986

Please note, the phosphor-misc:usb-ctrl have a way to specify mode usb|usb-ro|hdd|dvd which is useful to pick between both usb or cd-rom devices. Please, refer to the changes [1].

The implementation of usb-gadget:mass-storage has a many limitations about cd-rom:
* Image size should not be significant then 2.1Gb,
* Supports only CD-ROM profile
That does following to failure of installing Windows-like OS, because without a number of DVD-ROM profile's features and correct SCSI-command handling(TOC/ATIP/PMA) a Windows OS can't load appropriate UDF-driver(iso-13346) and will stucks.

Summary the mentioned in the current subject patchset should solve the described issue.

Quoted 3 lines

Thanks,
Troy Lee

Links:
* https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-misc/+/36499

Signature · 3 lines
Best regards,

Igor Kononenko
#13 lore raw

Hi Igor,

Quoted 13 lines

-----Original Message-----
From: i.kononenko <[email protected]>
Sent: Wednesday, August 4, 2021 10:11 AM
To: Troy Lee <[email protected]>; Konstantin Klubnichkin <[email protected]>
Cc: [email protected]
Subject: Re: Installing Windows Server 2019 from a remotely mounted ISO

Hello Troy,

Quoted 2 lines · Troy Lee

Hi Igor,

Quoted 8 lines
Quoted 1 line

Currently, the remote virtual media emulate the gadget driver as usb

thumb drive instead of cd-rom.

Quoted 2 lines

Please have a look on my patch:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/42986

Please note, the phosphor-misc:usb-ctrl have a way to specify mode usb|usb-ro|hdd|dvd which is useful to pick between both usb or cd-rom devices. Please, refer to the changes [1].

This looks very useful, good information to know.
Do frontend (web-vue/phosphor-webui) and backend (bmcweb) support it already?

Quoted 9 lines

The implementation of usb-gadget:mass-storage has a many limitations about cd-rom:
* Image size should not be significant then 2.1Gb,
* Supports only CD-ROM profile
That does following to failure of installing Windows-like OS, because without a number of DVD-ROM profile's features and correct SCSI-command handling(TOC/ATIP/PMA) a Windows OS can't load appropriate UDF-driver(iso-13346) and will stucks.

Quoted 3 lines

Summary the mentioned in the current subject patchset should solve the described issue.

I'll give it a try, this might also solve our virtual media stress issues.

Quoted 4 lines
Quoted 3 lines

Thanks,
Troy Lee

Quoted 8 lines

Links:
* https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-misc/+/36499

--
Best regards,

Igor Kononenko

Thanks,
Troy Lee

#14 lore raw

Troy,

Quoted 17 lines · Troy Lee

Hi Igor,

Quoted 15 lines

-----Original Message-----
From: i.kononenko <[email protected]>
Sent: Wednesday, August 4, 2021 10:11 AM
To: Troy Lee <[email protected]>; Konstantin Klubnichkin <[email protected]>
Cc: [email protected]
Subject: Re: Installing Windows Server 2019 from a remotely mounted ISO

Hello Troy,

Quoted 3 lines · Troy Lee

Hi Igor,

Currently, the remote virtual media emulate the gadget driver as usb

thumb drive instead of cd-rom.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Please have a look on my patch:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/42986

Please note, the phosphor-misc:usb-ctrl have a way to specify mode usb|usb-ro|hdd|dvd which is useful to pick between both usb or cd-rom devices. Please, refer to the changes [1].

This looks very useful, good information to know.
Do frontend (web-vue/phosphor-webui) and backend (bmcweb) support it already?

AFAIK, the bmcweb and WebUI don't support to specify Virtual Media type, but I have a number of patches that bring such features but there are not published yet.

In the past, I have published a bmcweb patch for supports VM mode for the nbd-proxy, but the change was not framed properly and has been abandoned [1].

Quoted 23 lines
Quoted 10 lines

The implementation of usb-gadget:mass-storage has a many limitations about cd-rom:
* Image size should not be significant then 2.1Gb,
* Supports only CD-ROM profile
That does following to failure of installing Windows-like OS, because without a number of DVD-ROM profile's features and correct SCSI-command handling(TOC/ATIP/PMA) a Windows OS can't load appropriate UDF-driver(iso-13346) and will stucks.

Quoted 3 lines

Summary the mentioned in the current subject patchset should solve the described issue.

I'll give it a try, this might also solve our virtual media stress issues.

Quoted 8 lines
Quoted 3 lines

Thanks,
Troy Lee

Links:
* https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-misc/+/36499

Quoted 8 lines
Quoted 4 lines

--
Best regards,

Igor Kononenko

Thanks,
Troy Lee

Links:
1 - https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/36475

Signature · 3 lines
Best regards,

Igor Kononenko

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw

Hi Konstantin,

Quoted 1 line · Konstantin Klubnichkin

Did you succeed to include this pachset into upstream?

FWIW, we're using those patches on a rather old fork, and they work great.

But there seems to be a serious throughput limitation for an AST2500 getting data over NCSI. With typical OpenBMC load on CPU we are limited to about 1.0 MB/s (testing with netcat running on BMC receiving a file of fixed length with TCP and directing it to /dev/null), so installation from virtual media is quite slow.

Can you please benchmark your system for comparison? Do you use NCSI for the management channel?

For the reference, USB mass storage gadget is able to stream data to the host OS at about 11.5 MB/s.

Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[email protected]
#17 lore raw
In reply to a message not in the archive
Quoted 5 lines · Konstantin Klubnichkin

«Внимание! Данное письмо от внешнего адресата!»

Hello, Igor!
Did you succeed to include this pachset into upstream? Thank you!

Hello Konstantin!

Unfortunately, I've suspended work with publishing patches into upstream of the usb-gadget fmc. The community point is the big rework of the usb-gadget:fmc subsystem is not required, and moreover we should avoid that, because there is a user-space gadget driver that may provide a wider number of features and could be more agile.

My opinion at this point is that the OpenBMC VirtualMedia implementation could be based on the GadgetFS driver with ConfigFS feature. I was plan to prepare a design-doc proposal with PoC, but today I have too wide list of critical tasks.

Quoted 31 lines

03.08.2021, 15:53, "i.kononenko" <[email protected]>:

Hello Konstantin,

I have several patches [1] to solves mounting DVD-based ISOs through Virtual Media.
The published changes is WIP until had approved by the Linux Foundation community,
but in the YADRO, we use these changes to support installing the OS Windows via Virtual Media.

I hope your will found it helpful that information to support installing Windows-based OS.

Links:
[1] - https://patchwork.kernel.org/project/linux-usb/list/?series=507583
<https://patchwork.kernel.org/project/linux-usb/list/?series=507583>

--
Best regards,

Igor Kononenko

Signature · 6 lines
Best regards,
Konstantin Klubnichkin,
lead firmware engineer,
server hardware R&D group,
Yandex Moscow office.
tel: +7-903-510-33-33
Signature · 3 lines
Best regards,

Igor Kononenko