qubes-doc/customization/windows-template-customization.md

168 lines
6.1 KiB
Markdown
Raw Normal View History

---
layout: doc
title: Windows Template Customization
permalink: /doc/windows-template-customization/
redirect_from: /en/doc/windows-template-customization/
---
2015-10-16 05:16:13 -04:00
Disable/Uninstall unecessary features/services
=============================
2015-10-16 05:16:13 -04:00
Windows features
----------------------------
2015-10-16 05:28:58 -04:00
Uninstall windows features from Control Panel > Turn windows features On/Off.
Generally, it will be required to reboot after features desinstallation.
If you do not manage to uninstall some features, it is sometimes necessarry to uninstall them one by one or two by two.
Only keep:
* Print and Document Service => Internet Printing Client
* Print and Document Service => Windows Fax and Scan (apparently it cannot be uninstalled)
* Windows search
*Note*: Windows search is recommended because it is a nightmare to find something in menus if it is not enabled (it removes the search bar from the start menu, from the explorer, and from the control panel).
2015-10-16 05:28:58 -04:00
*Note*: Unselecting windows media, .Net and Internet Explorer will uninstall these components. on a new install it is generally old versions anyway and it will be quicker to install directly the new versions later.
Services
2015-10-16 05:16:13 -04:00
Windows services
---------------------------
Disable the following services that are not required or have no sense in a VM context:
* Base Filtering Engine (only required if your want to use Microsoft IPSEC)
* DHCP Client
* Function Discovery Provider Host
2015-10-16 05:28:58 -04:00
this will not work anyway because SSDP discovery uses multicast - need to be on the same network which is not the case because of qubes firewall
* Peer Name Resolution Protocol
* Peer Netwoking Grouping
* Peer Networking Identity Manager
* SSDP Discovery
* Security Center (is it only notifications ?)
* TCP/IP Netbios Help (is Netbios still really used by Windows ? Maybe for discovery only ?)
* Themes (if you don't care about theme)
* Volume Shadow Copy (see next note in the performance section)
* Windows defender
* Windows Firewall
* Power
*Notes*: IP Helper is required as it is used by Qubes Agent to configure the IP address.
2015-10-16 05:16:13 -04:00
Windows update
--------------------------
2015-10-16 05:28:58 -04:00
I recommend disabling windows update (Never Check for Update) because checking for updates will start every time you start an AppVM if you don't started your template after some days.
Running windows update is also apparently IO hungry.
Of course I recommend starting the template regularly and checking manually for updates.
2015-10-16 05:16:13 -04:00
System properties
---------------------------
2015-10-16 05:28:58 -04:00
Right click on computer and go to Properties > Advanced > Performances:
* If your don't care about visual effect, in Visual Effect select "Adjust for best performance"
2015-10-16 05:28:58 -04:00
* I personnally tweak the page file size to win some place on my root.
In Advanced>Performances>Advanced tab, change Virtual memory:
2015-10-16 05:30:36 -04:00
2015-10-16 05:28:58 -04:00
1. unselect automatically manage paging file size for all drive
2. click on drive C:
3. select no paging file
4. click on set
5. click on drive d:
6. select customer size
7. use an initial size of 500 and a max size of 1000. If the page file is too small, you will notify a low memory pop up when working on windows. In this case, it often means that you should extend your AppVM RAM.
* System Protection
2015-10-16 05:28:58 -04:00
Here you can disable Shadow Folder because it has little sense in case of qubes because
* we do backup regularly of AppVMs/TemplateVMs;
* we can revert at least one template change if we break something.
Select drives where system protection is enabled and click Configure. "Turn of system protection" "Delete all restore points"
* Remote
2015-10-16 05:28:58 -04:00
Unselect Allow Remote Assistance connetions to this computer.
2015-10-16 05:16:13 -04:00
Task scheduler
-----------------------
2015-10-16 05:28:58 -04:00
Open the task scheduler and *disable* the following tasks.
If you remove these tasks they may be recreated automatically by various windows management tools (such as defragmentation)
* Autochk: All
* Application Experience: All
* Customer Experience Improvement Program: All
* Defrag: All
* DiskDiagnosis: All (the disk is virtual anyway so S.M.A.R.T. has no sense)
* Maintenance: All
* SystemRestore: All
* WindowsBackup: All
2015-10-16 05:16:13 -04:00
Disable hibernation
------------------------------
and clean hyberfil.sys
2015-10-16 05:16:13 -04:00
1. Ensure that you disabled the Power service (you may need to reboot so that the Power service is effectively stopped).
2015-10-16 05:16:13 -04:00
2. Run a cmd.exe as an administrator:
> powercfg -h off
C:\hyberfil.sys should now be deleted
2015-10-16 05:16:13 -04:00
Manual tasks that can/should be started in the template
===================================
* Disk defragmentation
2015-10-16 05:20:15 -04:00
* Windows Update
2015-10-16 05:20:15 -04:00
* Windows file cleaning
2015-10-16 05:16:13 -04:00
1. Run windows drive cleaner as Administrator.
2. Enable all the task and run the cleaner
* CCleaner file cleaning
2015-10-16 05:16:13 -04:00
1. Install CCleaner free
2. Copy the attached ccleaner configuration file in CCleaner program file folder
3. Run ccleaner with all option set except "wipe free space" (it will also remove user history and preferences)
4. Run ccleaner only with the option "wipe free space".
2015-10-16 05:20:15 -04:00
It will write zeros in all unused space. This will allow you to strip the root.img file later
2015-10-16 05:20:15 -04:00
* TemplateVM stripping
Ensure that you know what you are doing in this section as you may destroy by error your template root.img file.
2015-10-16 05:20:15 -04:00
* If you ran ccleaner with "wipe free space", follow the following procedure
2015-10-16 05:16:13 -04:00
1. from dom0, go to /var/lib/templates-vm/yourtemplate
2015-10-16 05:23:02 -04:00
2. copy root.img using the following command
2015-10-16 05:20:15 -04:00
2015-10-16 05:28:58 -04:00
> cp --sparse=always root.img root.img.clean
2015-10-16 05:23:02 -04:00
3. if the copy worked, you can move the new root file by running this command
2015-10-16 05:28:58 -04:00
> mv root.img.clean root.img
2015-10-16 05:20:15 -04:00
* If don't managed to fill the free space with zeroes, you can follow the following *unsafe* undocumented procedure
2015-10-16 05:23:02 -04:00
1. from dom0, go to /var/lib/templates-vm/yourtemplate
2. check the partitionning to identify the filesystem offset of root.img
3. mount the filesystem
4. create a file with zeros inside the filesystem until the mounted filesystem is full
5. remove the file
2015-10-16 05:16:13 -04:00
6. unmount the partition
2015-10-16 05:23:02 -04:00
7. make a copy of root.img in sparse mode.