1.. _section-windows:
2
3The Windows Version of Bareos
4=============================
5
6:index:`\ <single: Platform; Windows>`
7:index:`\ <single: Windows>`
8
9The Windows version of Bareos is a native Win32 port, but there are very few source code changes to the Unix code, which means that the Windows version is for the most part running code that has long proved stable on Unix systems.
10
11Chapter :ref:`SupportedOSes` shows, what Windows versions are supported.
12
13The Bareos component that is most often used in Windows is the File daemon or Client program. As a consequence, when we speak of the Windows version of Bareos below, we are mostly referring to the File daemon (client).
14
15Once installed Bareos normally runs as a system service. This means that it is immediately started by the operating system when the system is booted, and runs in the background even if there is no user logged into the system.
16
17.. _Windows:Installation:
18
19.. _Windows:Configuration:Files:
20
21Windows Installation
22--------------------
23
24:index:`\ <single: Installation; Windows>`
25:index:`\ <single: Windows; File Daemon; Installation>`
26
27Normally, you will install the Windows version of Bareos from the binaries. The **winbareos** binary packages are provided under http://download.bareos.org/bareos/release/latest/windows. Additionally, there are `OPSI <http://www.opsi.org>`_ packages available under http://download.bareos.org/bareos/release/latest/windows/opsi.
28
29This install is standard Windows .exe that runs an install wizard using the NSIS Free Software installer, so if you have already installed Windows software, it should be very familiar to you. Providing you do not already have Bareos installed, the installer installs the binaries and dlls in :file:`C:\\Program Files\\Bareos` and the configuration files in :file:`C:\\ProgramData\\Bareos` (for Windows XP and older:
30:file:`C:\\Documents and Settings\\All Users\\Application Data\\Bareos`).
31
32In addition, the Start\->All Programs\->Bareos menu item will be created during the installation, and on that menu, you will find items for editing the configuration files, displaying the document, and starting a user interface.
33
34During installation you can decide, what Bareos components you want to install.
35
36Typically, you only want to install the Bareos Client (|fd|) and optionally some interface tools on a Windows system. Normally, we recommend to let the server components run on a Linux or other Unix system. However, it is possible, to run the |dir|, |sd| and |webui| on a Windows systems. You should be aware about following limitations:
37
38.. limitation:: Windows: |dir| does not support MySQL database backend.
39
40
41   When running the Director on Windows, only PostgreSQL (and SQLite) database backends are supported.
42   SQLite is best suited for test environments.
43
44
45
46
47.. limitation:: Windows: Storage Daemon only supports backup to disk, not to tape.
48
49   The Windows version of the |sd| currently only supports backup to disk.
50   Access to tape devices and to media changers is not supported.
51
52
53.. limitation:: Windows: The default installation of |webui| is only suitable for local access.
54
55   Normally the |webui| is running on a Apache server on Linux.
56   While it is possible, to run the |webui| under Apache or another Webserver which supports PHP under Windows,
57   the configuration shipped the the **winbareos** package uses the PHP internal webserver.
58   This is okay for local access, but not suitable for being accessed via the network.
59   To guarantee this, it is configured to only listen locally (http://localhost:9100).
60
61
62
63
64Graphical Installation
65~~~~~~~~~~~~~~~~~~~~~~
66
67Here are the important steps.
68
69-  You must be logged in as an Administrator to the local machine to do a correct installation, if not, please do so before continuing.
70
71-  For a standard installation you may only select the "Tray-Monitor" and the "Open Firewall for Client" as additional optional components.
72
73.. image:: /include/images/win-install-1.*
74   :width: 80.0%
75
76
77
78-  You need to fill in the name of your bareos director in the client configuration dialogue and the FQDN or ip address of your client.
79
80.. image:: /include/images/win-install-2.*
81   :width: 80.0%
82
83
84
85-  Add the client resource to your Bareos Director Configuration and a job resource for the client as it is also described in the default bareos-dir.conf
86
87.. image:: /include/images/win-install-3.*
88   :width: 80.0%
89
90
91
92
93Command Line (Silent) Installation
94~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
96Silent installation is possible since :sinceVersion:`12.4.4: Windows: silent installation`. All inputs that are given during interactive install can now directly be configured on the commandline, so that an automatic silent install is possible.
97
98Commandline Switches
99^^^^^^^^^^^^^^^^^^^^
100
101/?
102   shows the list of available parameters.
103
104/S
105   sets the installer to silent. The Installation is done without user interaction. This switch is also available for the uninstaller.
106
107/CLIENTADDRESS
108   network address of the client
109
110/CLIENTNAME
111   sets the name of the client resource
112
113/CLIENTMONITORPASSWORD
114   sets the password for monitor access
115
116/CLIENTPASSWORD
117   sets the password to access the client
118
119/DBADMINUSER=user
120   sets the database admin user, default=postgres. :sinceVersion:`14.2.1: Windows Installation: DBADMINUSER`
121
122/DBADMINPASSWORD=password
123   sets the database admin password, default=\ *none*. :sinceVersion:`14.2.1: Windows Installation: DBADMINPASSWORD`
124
125/DIRECTORADDRESS
126   sets network address of the director for bconsole or bat access
127
128/DIRECTORNAME
129   sets the name of the director to access the client and of the director to accessed by bconsole and bat
130
131/DIRECTORPASSWORD
132   set the password to access the director
133
134/SILENTKEEPCONFIG
135   keep configuration files on silent uninstall and use exinsting config files during silent install. :sinceVersion:`12.4.4: Windows Installation: SILENTKEEPCONFIG`
136
137/INSTALLDIRECTOR
138   install the Bareos Director (and bconsole). :sinceVersion:`14.2.1: Windows Installation: INSTALLDIRECTOR`
139
140/INSTALLSTORAGE
141   install the Bareos Storage Daemon. :sinceVersion:`14.2.1: Windows Installation: INSTALLSTORAGE`
142
143/WRITELOGS
144   makes also non-debug installer write a log file. :sinceVersion:`14.2.1: Windows Installation: WRITELOGS`
145
146/D=:file:`C:\specify\installation\directory`
147   (Important: It has to be the last option!)
148
149By setting the Installation Parameters via commandline and using the silent installer, you can install the bareos client without having to do any configuration after the installation e.g. as follows:
150
151
152
153::
154
155   c:\winbareos.exe /S /CLIENTNAME=hostname-fd /CLIENTPASSWORD="verysecretpassword" /DIRECTORNAME=bareos-dir
156
157
158
159DBADMINUSER and DBADMINPASSWORD are used to create the bareos databases. If login is not possible silent installer will abort
160
161Dealing with Windows Problems
162-----------------------------
163
164:index:`\ <single: Problem; Windows>`\  :index:`\ <single: Windows; Dealing with Problems>`\
165
166Antivirus Program
167~~~~~~~~~~~~~~~~~
168
169If you are not using the portable option, and you have :config:option:`dir/fileset/EnableVss`\  (Volume Shadow Copy) enabled in the |dir| and you experience problems with Bareos not being able to open files, it is most likely that you are running an antivirus program that blocks Bareos from doing certain operations. In this case, disable the antivirus program and try another backup. If it succeeds, either get a different (better) antivirus program or use
170something like :config:option:`dir/job/ClientRunBeforeJob`\ /:config:option:`dir/job/ClientRunBeforeJob`\  to turn off the antivirus program while the backup is running.
171
172If turning off anti-virus software does not resolve your VSS problems, you might have to turn on VSS debugging. The following link describes how to do this: http://support.microsoft.com/kb/887013/en-us.
173
174Enable Debuggging
175~~~~~~~~~~~~~~~~~
176
177In case of problems, you can enable the creation of log files. For this you have to use the :command:`bconsole` :ref:`setdebug <bcommandSetdebug>` command:
178
179.. code-block:: bconsole
180   :caption: Enable debug
181
182   *<input>setdebug client=bareos-fd level=200 trace=1</input>
183   Connecting to Client bareos-fd at bareos.example.com:9102
184   2000 OK setdebug=200 trace=1 hangup=0 tracefile=c:\bareos-fd.trace
185
186.. _Compatibility:
187
188Windows Compatibility Considerations
189------------------------------------
190
191:index:`\ <single: Windows; Compatibility Considerations>`\
192
193Exclusively Opened Files
194~~~~~~~~~~~~~~~~~~~~~~~~
195
196If you are not using the :ref:`VSS` option and if any applications are running during the backup and they have files opened exclusively, Bareos will not be able to backup those files, so be sure you close your applications (or tell your users to close their applications) before the backup. Fortunately, most Microsoft applications do not open files exclusively so that they can be backed up. However, you will need to experiment. In any case, if Bareos cannot open the file, it will
197print an error message, so you will always know which files were not backed up. If Volume Shadow Copy Service is enabled, Bareos is able to backing up any file.
198
199Backing up the Windows Registry
200~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201
202During backup, Bareos doesn’t know about the system registry, so you will either need to write it out to an ASCII file using :command:`regedit /e` or use a program specifically designed to make a copy or backup the registry.
203
204Windows Reparse Points
205~~~~~~~~~~~~~~~~~~~~~~
206
207:sinceVersion:`12.4.5: Windows: Reparse points`
208
209:index:`\ <single: Windows; Symbolic links>`\  :index:`\ <single: Windows; Junction points>`\  :index:`\ <single: Windows; Volume Mount Points (VMP)>`\
210
211Besides normal files and directories, Windows filesystems also support special files, called "Reparse Points". Bareos can handle the following types of Reparse points:
212
213-  Symbolic links to directories
214
215-  Symbolic links to files
216
217-  Junction Points
218
219-  Volume Mount Points
220
221The Volume Mount Points are a special case of a Junction Point. To make things easier, in the following when talking about Junction Points, we mean only the Junction Points that are not Volume Mount Points.
222
223The Symbolic Links and the Junction Points are comparable to Symbolic Links in Unix/Linux. They are files that point to another location in the filesystem.
224
225Symbolic Links and Junction Points can be created with the Windows commandline command :command:`mklink`.
226
227When doing a directory listing in the commandline (cmd) in Windows, it shows the filetypes JUNCTION, SYMLINK or SYMLINKD and the target between the square brackets:
228
229.. code-block:: shell-session
230   :caption: special files
231
232   C:\linktest>dir
233    Volume in drive C has no label.
234    Volume Serial Number is C8A3-971F
235
236    Directory of C:\linktest
237
238   08/07/2014  03:05 PM    <DIR>          .
239   08/07/2014  03:05 PM    <DIR>          ..
240   08/07/2014  02:59 PM    <SYMLINKD>     dirlink [C:\Program Files\Bareos]
241   08/07/2014  03:02 PM    <SYMLINK>      filelink [C:\Program Files\Bareos\bareos-dir.exe]
242   08/07/2014  03:00 PM    <JUNCTION>     junction [C:\Program Files\Bareos]
243   08/07/2014  03:05 PM    <JUNCTION>     volumemountpoint [\??\Volume{e960247d-09a1-11e3-93ec-005056add71d}\]
244                  1 File(s)              0 bytes
245                  5 Dir(s)  90,315,137,024 bytes free
246
247Symbolic Links. Directory Symbolic Links, and Junctions that are not a Volume MountPoint are treated by Bareos as symbolic links and are backed up and restored as they are, so the object is restored and points to where it pointed when it was backed up.
248
249Volume Mount Points are different. They allow to mount a harddisk partition as a subfolder of a drive instead of a driveletter.
250
251When backing up a Volume Mount Point, it is backed up as directory.
252
253If :strong:`OneFS`\  is set to yes (default), the Volume Mount Point (VMP) is backed up as directory but the content of the VMP will not be backed up. Also, the Joblog will contain a message like this:
254
255.. code-block:: bareosmessage
256   :caption: Warning on Volume Moint Point and OneFS=yes
257
258   C:/linktest/vmp is a different filesystem. Will not descend from C:/linktest into it.
259
260This is the normal behavior of the :strong:`OneFS`\  option.
261
262If OneFS is set to no, the filedaemon will change into the VMP as if it was a normal directory and will backup all files found inside of the VMP.
263
264VMPs and VSS Snapshots
265^^^^^^^^^^^^^^^^^^^^^^
266
267As Virtual Mount Points mounts another Volume into the current filesystem, it is desired that if the content of the VMP will be backed up during the backup (``onefs = no``), we also want to have this volume snapshotted via VSS.
268
269To achieve this, we now automatically check every volume added to the VSS snapshotset if it contains VMPs, and add the volumes mounted by those VMPs to the vss snapshotset recursively.
270
271Volumes can be mounted nested and multiple times, but can only be added to the snapshotset once. This is the reason why the number of vmps can be greater than the number of volumes added for the volume mount points.
272
273The Job Log will show how many VMPs were found like this:
274
275.. code-block:: bareosmessage
276   :caption: Volume Mount Points are added automatically to VSS snapshots (if onefs=no)
277
278   Volume Mount Points found: 7, added to snapshotset: 5
279
280Accordingly, if OneFS is set to yes, we do not need to handle Volume Mount Points this way. If OneFS is set to yes (default), the joblog will contain the following information:
281
282.. code-block:: bareosmessage
283   :caption: Volume Mount Points are ignored on VSS snapshots (if onefs=yes)
284
285   VolumeMountpoints are not processed as onefs = yes.
286
287Hard Links
288~~~~~~~~~~
289
290Windows also supports hard links, even so they are seldom used. These are treated as normal files and will be restored as individual files (which will not be hardlinks again)
291
292.. _FilesNotToBackup:
293
294FilesNotToBackup Registry Key
295~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
296
297:sinceVersion:`14.2.0: Windows: FilesNotToBackup`
298
299:index:`\ <single: Windows; Exclude Files from Backup>`\
300
301Windows supports a special Registry Key that specifies the names of the files and directories that backup applications should not backup or restore.
302
303The full path to this registry key is ``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup``
304
305Bareos automatically converts these entries to wildcards which will be automatically excluded from backup.
306
307The backup log shows a short information about the creation of the exludes like this:
308
309.. code-block:: bareosmessage
310   :caption: Excludes according to the FilesNotToBackup registry key
311
312   Created 28 wildcard excludes from FilesNotToBackup Registry key
313
314More details can be found if the filedaemon is run in debug mode inside of the :file:`bareos-fd.trace` logfile. Each entry and the resulting wildcard are logged.
315
316.. code-block:: bareosmessage
317   :caption: translation between registry key FilesNotToBackup and Bareos Exclude FileSet
318
319   client-win-fd: win32.c:465-0 (1) "WER" :
320   client-win-fd: win32.c:482-0         "C:\ProgramData\Microsoft\Windows\WER\* /s"
321   client-win-fd: win32.c:527-0     ->  "C:/ProgramData/Microsoft/Windows/WER/*"
322   client-win-fd: win32.c:465-0 (2) "Kernel Dumps" :
323   client-win-fd: win32.c:482-0         "C:\Windows\Minidump\* /s"
324   client-win-fd: win32.c:527-0     ->  "C:/Windows/Minidump/*"
325   client-win-fd: win32.c:482-0         "C:\Windows\memory.dmp"
326   client-win-fd: win32.c:527-0     ->  "C:/Windows/memory.dmp"
327   client-win-fd: win32.c:465-0 (3) "Power Management" :
328   client-win-fd: win32.c:482-0         "\hiberfil.sys"
329   client-win-fd: win32.c:527-0     ->  "[A-Z]:/hiberfil.sys"
330   client-win-fd: win32.c:465-0 (4) "MS Distributed Transaction Coordinator" :
331   client-win-fd: win32.c:482-0         "C:\Windows\system32\MSDtc\MSDTC.LOG"
332   client-win-fd: win32.c:527-0     ->  "C:/Windows/system32/MSDtc/MSDTC.LOG"
333   client-win-fd: win32.c:482-0         "C:\Windows\system32\MSDtc\trace\dtctrace.log"
334   client-win-fd: win32.c:527-0     ->  "C:/Windows/system32/MSDtc/trace/dtctrace.log"
335
336It is possible to disable this functionality by setting the FileSet option :strong:`AutoExclude`\  to no.
337
338The JobLog will then show the following informational line:
339
340.. code-block:: bareosmessage
341   :caption: AutoExclude disabled
342
343   Fileset has autoexclude disabled, ignoring FilesNotToBackup Registry key
344
345For more details about the Windows registry key see http://msdn.microsoft.com/en-us/library/windows/desktop/bb891959%28v=vs.85%29.aspx#filesnottobackup.
346
347Windows dedup support
348~~~~~~~~~~~~~~~~~~~~~
349
350:sinceVersion:`12.4.5: Windows: dedupclication`
351
352Windows 2012 has dedup support which needs handling.
353
354Store all file attributes
355~~~~~~~~~~~~~~~~~~~~~~~~~
356
357:sinceVersion:`12.4.5: Windows: file attributes`
358
359Windows has gathered quite some special specific file flags over the years but not all are saved during backup so some are never restored by the restore process. The most important ones are the ARCHIVE flag which is "misused" by some programs for storing some special information. Others that are known not to be stored are the COMPRESSED flag which means that a restored file looses it and will be restored as an uncompressed file.
360
361Support for Windows EFS filesystems
362~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
363
364:sinceVersion:`12.4.5: Windows: Encrypted Filesystems (EFS)`
365
366Windows has support for a so called EFS filesystem. This is an encrypted filesystem, to be able to backup the data and to restore it we need to use a special API. With this API you in essence export the data on backup and import it on restore. This way you never have access to the unencrypted data but just import and export the encrypted data. This is the cleanest way of handling encryption by just seeing the data as some opaque data and not try to do anything special with it.
367
368
369.. _VSS:
370
371Volume Shadow Copy Service (VSS)
372--------------------------------
373
374:index:`\ <single: Windows; Volume Shadow Copy Service>`
375:index:`\ <single: Windows; VSS>`
376
377VSS is available since Windows XP. From the perspective of a backup-solution for Windows, this is an extremely important step. VSS allows Bareos to backup open files and even to interact with applications like RDBMS to produce consistent file copies. VSS aware applications are called VSS Writers, they register with the OS so that when Bareos wants to do a Snapshot, the OS will notify the register Writer programs, which may then create a consistent state in their application, which will be backed
378up. Examples for these writers are "MSDE" (Microsoft database engine), "Event Log Writer", "Registry Writer" plus 3rd party-writers. If you have a non-vss aware application a shadow copy is still generated and the open files can be backed up, but there is no guarantee that the file is consistent.
379
380Bareos produces a message from each of the registered writer programs when it is doing a VSS backup so you know which ones are correctly backed up.
381
382Technically Bareos creates a shadow copy as soon as the backup process starts. It does then backup all files from the shadow copy and destroys the shadow copy after the backup process. Please have in mind, that VSS creates a snapshot and thus backs up the system at the state it had when starting the backup. It will disregard file changes which occur during the backup process.
383
384VSS can be turned on by placing an
385
386:index:`\ <single: Enable VSS>`
387:index:`\ <single: VSS; Enable>`
388
389::
390
391   Enable VSS = yes
392
393in your FileSet resource.
394
395The VSS aware File daemon has the letters VSS on the signon line that it produces when contacted by the console. For example:
396
397::
398
399   Tibs-fd Version: 1.37.32 (22 July 2005) VSS Windows XP MVS NT 5.1.2600
400
401the VSS is shown in the line above. This only means that the File daemon is capable of doing VSS not that VSS is turned on for a particular backup. There are two ways of telling if VSS is actually turned on during a backup. The first is to look at the status output for a job, e.g.:
402
403::
404
405   Running Jobs:
406   JobId 1 Job NightlySave.2005-07-23_13.25.45 is running.
407       VSS Backup Job started: 23-Jul-05 13:25
408       Files=70,113 Bytes=3,987,180,650 Bytes/sec=3,244,247
409       Files Examined=75,021
410       Processing file: c:/Documents and Settings/user/My Documents/My Pictures/Misc1/Sans titre - 39.pdd
411       SDReadSeqNo=5 fd=352
412
413
414
415Here, you see under Running Jobs that JobId 1 is "VSS Backup Job started ..." This means that VSS is enabled for that job. If VSS is not enabled, it will simply show "Backup Job started ..." without the letters VSS.
416
417The second way to know that the job was backed up with VSS is to look at the Job Report, which will look something like the following:
418
419::
420
421   23-Jul 13:25 rufus-dir: Start Backup JobId 1, Job=NightlySave.2005-07-23_13.25.45
422   23-Jul 13:26 rufus-sd: Wrote label to prelabeled Volume "TestVolume001" on device "DDS-4" (/dev/nst0)
423   23-Jul 13:26 rufus-sd: Spooling data ...
424   23-Jul 13:26 Tibs: Generate VSS snapshots. Driver="VSS WinXP", Drive(s)="C"
425   23-Jul 13:26 Tibs: VSS Writer: "MSDEWriter", State: 1 (VSS_WS_STABLE)
426   23-Jul 13:26 Tibs: VSS Writer: "Microsoft Writer (Bootable State)", State: 1 (VSS_WS_STABLE)
427   23-Jul 13:26 Tibs: VSS Writer: "WMI Writer", State: 1 (VSS_WS_STABLE)
428   23-Jul 13:26 Tibs: VSS Writer: "Microsoft Writer (Service State)", State: 1 (VSS_WS_STABLE)
429
430
431
432In the above Job Report listing, you see that the VSS snapshot was generated for drive C (if other drives are backed up, they will be listed on the \bconsoleOutput{Drive(s)="C"} line. You also see the reports from each of the writer program. Here they all report VSS_WS_STABLE, which means that you will get a consistent snapshot of the data handled by that writer.
433
434VSS Problems
435~~~~~~~~~~~~
436
437:index:`\ <single: Windows; Problem; VSS>`
438:index:`\ <single: Windows; VSS; Problem>`
439:index:`\ <single: Windows; Problem; VSS>`
440:index:`\ <single: Problem; Windows; VSS>`
441
442If you are experiencing problems such as VSS hanging on MSDE, first try running vssadmin to check for problems, then try running ntbackup which also uses VSS to see if it has similar problems. If so, you know that the problem is in your Windows machine and not with Bareos.
443
444The FD hang problems were reported with MSDEwriter when:
445
446-  a local firewall locked local access to the MSDE TCP port (MSDEwriter seems to use TCP/IP and not Named Pipes).
447
448-  msdtcs was installed to run under "localsystem": try running msdtcs under networking account (instead of local system) (com+ seems to work better with this configuration).
449
450Backup/Restore of Windows Registry
451---------------------------------------
452The Windows Registry can be backed up using VSS.
453The VSS Registry Writer will make sure you can take a stable backup of the registry hives.
454
455The Registry is structured as different hives that are stored in separate files.
456You can find a list of hives with the corresponding files in the Registry itself under ``HKLM\System\CurrentControlSet\Control\hivelist``.
457By backing up the file that one of the hives is stored in, you'll get a backup of that part of the Registry.
458
459Well-Known Hives
460~~~~~~~~~~~~~~~~
461+-------------------+-----------------------------------------------------------+---------------------------------------------+
462| Registry Key      | File Location                                             | Description                                 |
463+===================+===========================================================+=============================================+
464| HKU\\<User-SID>   | %systemdrive%\\Users\\%username%\\NTUSER.DAT              | User Registry (each users's HKCU)           |
465+-------------------+-----------------------------------------------------------+---------------------------------------------+
466| HKLM\\BCD00000000 | \\Device\\HarddiskVolume1\\Boot\\BCD                      | Boot Configuration Database                 |
467+-------------------+-----------------------------------------------------------+---------------------------------------------+
468| HKLM\\COMPONENTS  | %systemroot%\\System32\\config\\COMPONENTS                | Component Based Servicing                   |
469+-------------------+-----------------------------------------------------------+---------------------------------------------+
470| HKLM\\HARDWARE    | in-memory only                                            | Hardware information determined at runtime  |
471+-------------------+-----------------------------------------------------------+---------------------------------------------+
472| HKLM\\SAM         | %systemroot%\\System32\\config\\SAM                       | Security Accounts Manager                   |
473+-------------------+-----------------------------------------------------------+---------------------------------------------+
474| HKLM\\SECURITY    | %systemroot%\\System32\\config\\SECURITY                  | Security Policies and User Permission       |
475+-------------------+-----------------------------------------------------------+---------------------------------------------+
476| HKLM\\SOFTWARE    | %systemroot%\\System32\\config\\SOFTWARE                  | System-wide settings, Application Settings  |
477+-------------------+-----------------------------------------------------------+---------------------------------------------+
478| HKLM\\SYSTEM      | %systemroot%\\System32\\config\\SYSTEM                    | Startup config, drivers and system services |
479+-------------------+-----------------------------------------------------------+---------------------------------------------+
480| HKU\\.DEFAULT     | %systemroot%\\System32\\config\\.DEFAULT                  | User Hive for Local System                  |
481+-------------------+-----------------------------------------------------------+---------------------------------------------+
482| HKU\\S-1-5-18     | %systemroot%\\System32\\config\\.DEFAULT                  | User Hive for Local System (alternate path) |
483+-------------------+-----------------------------------------------------------+---------------------------------------------+
484| HKU\\S-1-5-19     | %systemroot%\\ServiceProfiles\\LocalService\\Ntuser.dat   | User Hive for Local Service                 |
485+-------------------+-----------------------------------------------------------+---------------------------------------------+
486| HKU\\S-1-5-20     | %systemroot%\\ServiceProfiles\\NetworkService\\Ntuser.dat | User Hive for Network Service               |
487+-------------------+-----------------------------------------------------------+---------------------------------------------+
488
489Restoring the Registry
490~~~~~~~~~~~~~~~~~~~~~~
491To restore a part of the Registry, you simply restore the file containing the appropriate hive to another location on the machine.
492You can then use regedit to open ("mount") that restored hive file by selecting "Load Hive" in the "Registry" menu.
493With the hive mounted you can now export keys or subtrees from the mounted hive and import these at any other location.
494
495Once you're finished you should unload the hive using "Unload Hive" from the "Registry" menu.
496
497
498Windows Firewalls
499-----------------
500
501:index:`\ <single: Firewall; Windows>`
502:index:`\ <single: Windows; Firewall>`
503
504The Windows buildin Firewall is enabled since Windows version WinXP SP2. The Bareos installer opens the required network ports for Bareos. However, if you are using another Firewall, you might need to manually open the Bareos network ports. The |fd| listens on 9102/TCP.
505
506Network TCP Port
507~~~~~~~~~~~~~~~~
508
509If you want to see if the File daemon has properly opened the port and is listening, you can enter the following command in a shell window:
510
511.. code-block:: shell-session
512
513   netstat -an | findstr 910[123]
514
515Windows Restore Problems
516------------------------
517
518:index:`\ <single: Problem; Windows Restore>`
519:index:`\ <single: Windows; Restore Problem>`
520
521Please see the :ref:`section-RestoreOnWindows` chapter for problems that you might encounter doing a restore.
522
523Windows Backup Problems
524-----------------------
525
526:index:`\ <single: Problem; Windows Backup>`
527:index:`\ <single: Windows; Backup Problems>`
528
529If during a Backup, you get the message: ERR=Access is denied and you are using the portable option, you should try both adding both the non-portable (backup API) and the Volume Shadow Copy options to your Director’s conf file.
530
531In the Options resource:
532
533::
534
535   portable = no
536
537
538
539In the FileSet resource:
540
541::
542
543   enablevss = yes
544
545
546
547In general, specifying these two options should allow you to backup any file on a Windows system. However, in some cases, if users have allowed to have full control of their folders, even system programs such a Bareos can be locked out. In this case, you must identify which folders or files are creating the problem and do the following:
548
549#. Grant ownership of the file/folder to the Administrators group, with the option to replace the owner on all child objects.
550
551#. Grant full control permissions to the Administrators group, and change the user’s group to only have Modify permission to the file/folder and all child objects.
552
553Thanks to Georger Araujo for the above information.
554
555Windows Ownership and Permissions Problems
556------------------------------------------
557
558:index:`\ <single: Problem; Windows Ownership and Permissions>`
559:index:`\ <single: Windows; Ownership and Permissions Problems>`
560
561If you restore files backed up from Windows to an alternate directory, Bareos may need to create some higher level directories that were not saved (or restored). In this case, the File daemon will create them under the SYSTEM account because that is the account that Bareos runs under as a service and with full access permission. However, there may be cases where you have problems accessing those files even if you run as administrator. In principle, Microsoft supplies you with the way to cease
562the ownership of those files and thus change the permissions. However, a much better solution to working with and changing Win32 permissions is the program SetACL, which can be found at `http://setacl.sourceforge.net/ <http://setacl.sourceforge.net/>`_.
563
564If you have not installed Bareos while running as Administrator and if Bareos is not running as a Process with the userid (User Name) SYSTEM, then it is very unlikely that it will have sufficient permission to access all your files.
565
566Some users have experienced problems restoring files that participate in the Active Directory. They also report that changing the userid under which Bareos (bareos-fd.exe) runs, from SYSTEM to a Domain Admin userid, resolves the problem.
567
568
569
570Advanced Windows Configuration
571------------------------------
572
573Windows Service
574~~~~~~~~~~~~~~~
575
576The |fd| (and also the |dir| and |sd|) is started as a Windows service.
577
578This is configured in the Registry at
579
580-
581
582   ``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Bareos-fd``
583
584You can use the command :command:`regedit` to modify the settings.
585
586E.g. to always start Bareos in debug mode, modify ``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Bareos-fd`` :file:`ImagePath` from
587
588
589
590::
591
592   "C:\Program Files\Bareos\bareos-fd.exe" /service
593
594to
595
596
597
598::
599
600   "C:\Program Files\Bareos\bareos-fd.exe" /service -d200
601
602After restarting the service, you will find a file called :file:`C:\bareos-fd.trace` which will contain the debug output created by the daemon.
603
604Installing multiple Windows filedaemon services
605^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
606
607It is possible to run multiple |fd| instances on Windows. To achieve this, you need to create a service for each instance, and a configuration file that at least has a individual fd port for each instance.
608
609To create two bareos-fd services, you can call the following service create calls on the commandline on windows as administrator:
610
611.. code-block:: shell-session
612
613   sc create bareosfd2 binpath="\"C:\Program Files\Bareos\bareos-fd.exe\" /service  -c \"C:\ProgramData\Bareos\bareos-fd2.conf\""  depend= "tcpip/afd"
614   sc create bareosfd3 binpath="\"C:\Program Files\Bareos\bareos-fd.exe\" /service  -c \"C:\ProgramData\Bareos\bareos-fd3.conf\""  depend= "tcpip/afd"
615
616This will create two |fd| services, one with the name bareosfd2 and the second with the name bareosfd3.
617
618The configuration files for the two services are :file:`bareos-fd.conf` and :file:`bareos-fd2.conf`, and need to have different network settings.
619
620The services can be started by calling
621
622.. code-block:: shell-session
623
624   sc start bareosfd2
625
626and
627
628.. code-block:: shell-session
629
630   sc start bareosfd3
631
632Windows Specific Command Line Options
633~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
634
635:index:`\ <single: Windows; File Daemon; Command Line Options>`\
636
637These options are not normally seen or used by the user, and are documented here only for information purposes. At the current time, to change the default options, you must either manually run Bareos or you must manually edit the system registry and modify the appropriate entries.
638
639In order to avoid option clashes between the options necessary for Bareos to run on Windows and the standard Bareos options, all Windows specific options are signaled with a forward slash character (/), while as usual, the standard Bareos options are signaled with a minus (-), or a minus minus (``--``). All the standard Bareos options can be used on the Windows version. In addition, the following Windows only options are implemented:
640
641/service
642   Start Bareos as a service
643
644/run
645   Run the Bareos application
646
647/install
648   Install Bareos as a service in the system registry
649
650/remove
651   Uninstall Bareos from the system registry
652
653/about
654   Show the Bareos about dialogue box
655
656/status
657   Show the Bareos status dialogue box
658
659/events
660   Show the Bareos events dialogue box (not yet implemented)
661
662/kill
663   Stop any running Bareos
664
665/help
666   Show the Bareos help dialogue box
667
668It is important to note that under normal circumstances the user should never need to use these options as they are normally handled by the system automatically once Bareos is installed. However, you may note these options in some of the .bat files that have been created for your use.
669