Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject drivers and other files into Windows iso image #135

Closed
harmw opened this issue Nov 6, 2013 · 9 comments
Closed

Inject drivers and other files into Windows iso image #135

harmw opened this issue Nov 6, 2013 · 9 comments

Comments

@harmw
Copy link
Contributor

harmw commented Nov 6, 2013

Hi,

In order to install Windows 2012 with virtio one needs to mount the driver disc from http://alt.fedoraproject.org/pub/alt/virtio-win/. It'd be great if oz could inject these (any) drivers into the installation iso image primarily to support virtio installations.

Furthermore, to support a more cloudy setup oz should be able to inject a setupcomplete.cmd file into a freshly installed system, allowing final customization when setup has finished.

Thanks.

@luisfdez
Copy link
Contributor

luisfdez commented Nov 6, 2013

Hi @harmw,

I sent a PR a few months ago related with this (#54). It allows you to add content to the ISO image before starting the installation, you can place the virtio drivers there and point from you unattend installation to that folder.

You can also use it for adding the old $OEM$ folder if you want, and using it properly you can place your setupcomplet.cmd that will be automatically copied to the filesystem.

Cheers,
Luis

@clalancette
Copy link
Owner

Yep, exactly as Luis says. In theory there is also the mechanism which allows you to copy files into the guest during the customization phase, but that doesn't work with Windows. So for now you'll have to go with using the $OEM$ folder.

@luisfdez
Copy link
Contributor

luisfdez commented Nov 7, 2013

@harmw, does the answer help you?

What @clalancette said also reminds me that I have a pending patch to support <file> section of the template on Windows. It's basically a clone of https://github.com/clalancette/oz/blob/master/oz/OpenSUSE.py#L381. @clalancette do you think it's a good option for a PR?

Anyway, having <file> section wouldn't help you with the SetupComplete.cmd scenario as the customization stage runs after the installation, and for SetupComplete.cmd you should have it in the filesystem before finishing the installation, that's why the $OEM$ folder structure in the ISO will help you.

If it helps you, part of my TDL files look like.

      <extras>
         <directory source="file:///path/private/isos/common"
                    destination="sources/$OEM$"/>
         <directory source="file:///path/virtio/0.1-52/WIN8/AMD64"
                    destination="sources/$OEM$/$1/Drivers/virtio"/>
      </extras>

For the virtio case (in the example copied to C:\Drivers\virtio), while writing your unattend files, you have to point the driver path to the installation media, as the hd filesystem itself depends on the driver, so I use something like this in the xml:

            <DriverPaths>
                <PathAndCredentials wcm:keyValue="cd2de24e" 
                                    wcm:action="add">
                    <Path>D:\sources\$OEM$\$1\Drivers\virtio</Path>
                </PathAndCredentials>
            </DriverPaths>

@harmw
Copy link
Contributor Author

harmw commented Nov 7, 2013

Hi guys, looks like i've missed this in the man pages. The above works as expected, as far as the tdl is concerned. In which settings pass and component should I put the DriverPaths code in the unattended.xml?

Using component Microsoft-Windows-PnpCustomizationsWinPE in settings pass="windowsPE" didn't install anything.

@luisfdez
Copy link
Contributor

luisfdez commented Nov 7, 2013

You're right, this functionality needs more documentation...

For me, it works in windowsPE settings. You can also check in the modified ISO image if everything is ok (in my example, inside the virtio folder there are no subfolders).

<settings pass="windowsPE">
...
..
...
....
        <component name="Microsoft-Windows-PnpCustomizationsWinPE" 
                   processorArchitecture="amd64"
                   publicKeyToken="31bf3856ad364e35"
                   language="neutral"
                   versionScope="nonSxS"
                   xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DriverPaths>
                <PathAndCredentials wcm:keyValue="cd2de24e" 
                                    wcm:action="add">
                    <Path>D:\sources\$OEM$\$1\Drivers\virtio</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>

@harmw
Copy link
Contributor Author

harmw commented Nov 7, 2013

Are you installing with virtio as will (oz-install -b virtio)? I'm still without succes on this, setup complains about the disks layout which is most likely because of missing virtio drivers.
I've added the block above at the top of my windows2012.auto file, as the first item within the element.

@luisfdez
Copy link
Contributor

luisfdez commented Nov 8, 2013

Yes, I'm specifying -b virtio for disk and -n virtio for network. Could you paste the TDL part where you point to the virtio folder?

@harmw
Copy link
Contributor Author

harmw commented Nov 8, 2013

Nevermind, I noticed my oz-install command was missing the -a parameter so it didn't use my custom unattended xml. Perhaps the documentation on this can be extended?

It works like a charm now, though I'm mostly using the cloudbase xml from https://raw.github.com/cloudbase/windows-openstack-imaging-tools/master/Autounattend.xml. I also suffered from https://bugzilla.redhat.com/show_bug.cgi?id=966861, so using 0.52 virtio drivers helped as well.

On to including cloud-init stuff :)

Thanks you both.

@harmw harmw closed this as completed Nov 8, 2013
@shake
Copy link

shake commented Feb 3, 2014

Hi harmw

whether can share more detail how to use Oz install windows 2012 image, that can include cloud init?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants