How do I handle .WIM image files?
I have an Asus netbook, and its recovery partition and recovery DVD have several images in .WIM format.
Are there any Linux/Ubuntu tools to handle those images? Im looking for the equivalents of dism
, ImageX
, etc. But any tool (GUI or CLI) that could mount or extract or view its contents would be nice.
Gathering @fossfreedom 's and @Rinzwind 's ideas about 7z and Archive Manager, and tweaking with some of my own, I guess ive found a nice solution:
Archive Manager (actually File Roller) supports 7z (as long as p7zip package is installed), and 7z supports WIM (thanks guys!). But here is the catch: File Roller does not know that 7z supports WIM. So the trick consists in "fooling" File Roller to think WIM files are actually 7z. Sure, renaming (or appending) WIM filenames with ".7z" extension works. But it can be more elegant than that.
Ive downloaded and and examined File Roller's source code, and found out that it (thankfully) detects files by mime types, not filenames.
So the complete solution could be:
-
Make sure you have p7zip package installed. You can install it with the following command:
sudo apt-get install p7zip-full
For Mime-Type dababase editing, install assoGiate (File Types Editor). Its a very easy, intuitve, well-polished tool. A must-have for mime-type editing. Saved me more than once, including now
-
To install it in Ubuntu 12.04 (Precise), use the following command:
sudo apt-get install assogiate
-
To install it in Ubuntu 14.04 (Trusty), you need to install libgnome-vfsmm-2.6-1c2a manually at Launchpad. In "Published versions", click on the release of your architecture. In the next page, download the *.deb file in "Downloadable files". We need to install libxml++2.6-2 available in Universe repo too, so we can install assoGiate using dpkg:
sudo dpkg -i libgnome-vfsmm-2.6-1c2a_2.26.0-1build1_amd64.deb sudo apt-get update sudo apt-get install libxml++2.6-2 sudo dpkg -i assogiate_0.2.1-3_amd64.deb
Open it in
Menu > System Tools > File Type Editor
At it, go to
Type > Find
(CTRL+F, or search icon), type "7z".
Select x-7z-compressed, go to
Type > Edit
Go to
Filenames
tab, click onAdd
buttonType *.wim, click
Add
Close all dialogs, and presto!
Nautilus now show the WIM archives as a 7-zip archive. Which, given that is 7-zip that handles them, it is not entirely false. No renaming needed, filenames are intact.
- Double-click them, and good ol' Archive Manager opens them with no complains. No need of wine or any weird GUI
Note: these changes in the mime-type database are valid for the current user only. For a system-wide change, open File Type Editor as root:
gksudo assogiate &
Last but not least, for command line, all these steps can be skipped, and the following can be used:
7z x INPUTFILE.wim -oOUTPUTFOLDER
EDIT: From comments received, Archive Manager should in theory have WIM support. However for me trying to open a WIM gives a "Archive Type is not supported" error message. However, copying the WIM to my desktop and added a .7z extension allows Archive Manager to open the WIM directly. N.B. you need to install the 7Zip from the software center.
P7Zip has the ability to read WIM files. If you search for "7Zip" in software center, it will install the command line tool "7z"
use 7z --help for the options.
An example from my Windows 7 Recovery disc is as follows:
7z e /media/Recovery3/Patch/Modules/Acer-HQ1/SET/WinRE\ LP\ Setup/MOD01SET74EN0N0006.WIM 1.xml
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: /media/Recovery3/Patch/Modules/Acer-HQ1/SET/WinRE LP Setup/MOD01SET74EN0N0006.WIM[enter link description here][1]
Extracting 1.xml
Everything is Ok
Size: 1386
Compressed: 265513728
the .exe from the download site (link above) installs OK under wine (I'm using wine 1.3) - so you can browse the wim using a GUI:
Googling around, a native linux GUI is in short supply - here is one I've found, but I haven't tested this one myself