Hyper-V: store virtual machines on an SMB3 network share

 

Hyper-V: store virtual machines on an SMB3 network share


 

Windows Server 2012R2 Windows Server 2016 Windows Server 2019

 

Introduction

In this tutorial, I will explain how to configure a network share on Windows Server to store virtual machines created on Hyper-V on it.

Since Windows 2012, it is possible to store virtual machines created on Hyper-V on an SMB3 network share.

This solution allows to use the available storage of a physical computer to put virtual computers with Hyper-V. Since using a server is from my point of view more reliable than a NAS.

There are no real hardware prerequisites, but in order to guarantee correct access times and good performance, “fast” hard disks and RAID (5) must be provided and also a 10Gb network. It works in 1Gb too.

Regarding the software part, the servers (storage + hyper-v) must be under Windows Server 2012 minimum and member of the same Active Directory domain.


It is possible on paper to do this with NAS that supports SMB3, from experience it does not always work very well …

 

Network sharing configuration on Windows Server

To configure sharing, you have to go through the server manager and not the Windows file explorer.

First create the folder 1which will be shared.

Open server manager and go to share management 1.

Open the wizard for creating a share by clicking on TASKS 1then on New share 2.

Select the SMB Share – Applications 1profile and click Next 2.

Indicate the location of the 1folder that will be shared, and click Next 2.

If necessary change the name of the share and enter a description and click on Next 1.

Pass the other parameters by clicking on Next 1.

Add the Full Control permission to the computer object 1of the Active Directory of the Hyper-V server and click Next 2.

A preview of the sharing parameters is displayed, confirm the creation of it by clicking on Create 1.

Once the share has been created, exit the wizard by clicking on Close 1.

Share 1is visible in the list of shares.

 

Creating the virtual machine with Hyper-V on the network share

Now that the network share is ready, we will see how to create the virtual machine with Hyper-V so that it is stored on the network share.

From the Hyper-V console, create a new virtual machine by clicking on New 1/ Virtual machine 2.

When the wizard starts, click on Next 1.

Indicate the name of the virtual machine 1, check the Store virtual machine in another location 2box then indicate the UNC path of the share that was created 3and click on Next 4.

Then follow the wizard for creating the virtual machine.

 

 

 

 

 

Wait while the virtual machine is created.

The virtual machine is created 1and available in the Hyper-V console.

Looking in the shared folder, we can see that a folder with the name of the virtual machine has been created containing the various files of the VM.

 

 

From <https://rdr-it.com/en/hyper-v-store-virtual-machines-on-an-smb3-network-share/>

Windows stuck in automatic repair boot loop

 

 

Windows stuck in automatic repair boot loop

If the automatic repair couldn’t really repair your PC and just get you stuck in a repair loop, it’s better to disable the automatic startup repair. Type the following command and press Enter:

 

bcdedit /set {default} recoveryenabled No

 

2. A corrupted registry settings can also cause an auto-repair loop. Here is how to restore your registry from the RegBack directory. The RegBack folder is located in :/windows/system32/config, which is used by Windows to hold a recent backup copy of the registry hives.

 

Assuming your system drive is d:, run the following command to restore Windows registry:

copy d:\windows\system32\config\RegBack\* d:\windows\system32\config

 

if prompted to overwrite existing files, type All and hit Enter. Type exit and hit Enter to close the Command Prompt window. Restart your computer and most probably, you may able to access your Windows system as before.

 

From <https://social.technet.microsoft.com/Forums/en-US/720cc735-2eb7-4831-8b06-4ef7e44c5001/windows-server-2012-stuck-in-automatic-repair-loop-vmware?forum=smallbusinessserver2011essentials>

 

 

 

 

 

Created with OneNote.

Enable admin share using the registry

 

 

Enable admin share using the registry

BY Default the Admin share is disabled in Windows Server 2022 ( in fact, in windows 10 and server 2016 onwards it was). It can be enabled as follows:

 

  1. From the computer you’d like to enable the admin share, click Start or Cortana and immediately type “powershell“. From the list of results, right-click Powershell and select Run as administrator.
  2. Copy and paste the following command into the Powershell window and hit enter.

Enable-NetFirewallRule -DisplayGroup 'File and Printer Sharing'
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

  1. Reboot the computer.
  2. You can now browse to the computer’s admin share using a local administrative account of the machine. For example:
    \\computername\c$

 

From <https://cormang.com/2018/01/06/enable-c-admin-share-windows-10-server-2016/>

 

 

 

 

 

 

 

 

 

Created with OneNote.

What do the HTTP status codes, such as 403, 404, 500, mean?

 

 

What do the HTTP status codes, such as 403, 404, 500, mean?

What is an HTTP status code?

For every request from a webbrowser the server responds with a status code. If there was a error, you can get additional information about the error. You can find the most frequent error codes and a brief description in the list below.

 

HTTP Error 401 - Unauthorized

The 401 status code indicates that the HTTP request has not been applied because it lacks valid authentication credentials (usually username and password) for the target resource. If the request included authentication credentials the 401 response indicates that authorization has been refused for those credentials. Please check if your username and password are correct.

 

HTTP status 403 - Forbidden

This is a permissions issue. You often encounter this error when no index file (.htm, .html or .php) is present and the directory listing is off for a folder in the Web space (Line "Options -Indexes" in a .htaccess file). Sometimes user authentication was provided, but the authenticated user is not permitted to view the content of the folder or file. Other times the operation is forbidden to all users. Sometimes this error occurs if there are too many connections at the same time. The easyname support team can explain you this issue in depth.

 

HTTP status 404 - Not Found

This error message is shown when a site or folder on a server are requested but cannot be found at the given URL. Please check your input.

 

HTTP status 429 - Too Many Requests

The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time. A Retry-After header might be included to this response indicating how long to wait before making a new request. For example if more than 50 requests are received from the same IP address (cumulative hits) within the same second, our server will block that IP for the next 10 minutes as a security measure.

 

HTTP status 500 - Internal Server Error

This is a "catch all" status for unexpected errors. It is a server side error message common causes of this are eg. misconfigured .htaccess files or PHP errors, which you can check in the File php_error.log on your Webhost. You can find the php_error.log file in the /log/ directory - this directory can be found on the same level as your /html/ directory

 

HTTP status 503 - Service unavailable

This means, that the server is currently unavailable or the server is overallocated. You can check the file php_error.log as described for the status code 500.

Should you not find helpful error messages in the logfile, please try changing the session_cache to the option filesystem, you can do this in the easyname control panel if you navigate to [My Hosting]>>[PHP settings] and click the link "Settings". Please note that this change will take up to 15 minutes to take effect, so please try waiting 15 minutes before trying to call up your site and refresh it.

 

From <https://www.easyname.com/en/support/hosting/158-what-do-the-http-status-codes-such-as-403-404-500-mean>

 

Created with OneNote.

Windows installer logs

 

 

Windows installer logs

Windows installer logs are usually kept in the temp folder, you can get to this by going to run or an explorer bar and type the location as %temp%.

The default folder for this is:

C:\Users\<username>\AppData\Local\Temp

From This MS Support page:

To enable Windows Installer logging yourself, open the registry with Regedit.exe and create the following path and keys:

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer

Reg_SZ: Logging

 

Value: voicewarmupx

 

The letters in the value field can be in any order. Each letter turns on a different logging mode. Each letter's actual function is as follows fo r MSI version 1.1:

v - Verbose output

o - Out-of-disk-space messages

i - Status messages

c - Initial UI parameters

e - All error messages

w - Non-fatal warnings

a - Start up of actions

r - Action-specific records

m - Out-of-memory or fatal exit information

u - User requests

p - Terminal properties

+ -Append to existing file

! - Flush each line to the log

x - Extra debugging information. The "x" flag is available only on Windows Server 2003 and later operating systems, and on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.

 

"" - Wildcard, log all information except for the v and the x option. To include the v and the x option, specify "/lvx".

 

Note This should be used only for troubleshooting purposes and should not be left on because it will have adverse effects on system performance and disk space. Each time you use the Add/Remove Programs tool in Control Panel, a new Msi*.log file is created.

 

Please note that the above is just for MSI files or setups that take advantage of the Windows Installer. Some others will also create log files either in the temp folder, their application directory or the root of the hard drive. There is no one answer fits all.

 

You can also have the installer write an installation log wherever you like, as needed, without modifying the registry. Run the installer msiexec from the command line with the /L option. For example,

msiexec /i C:\Users\myusername\Downloads\somepackage.msi /L*v install.txt

 

This will run the install script and write all logging info (verbose) to the file install.txt

 

The options for the /L flag are:

i : Logs status messages.
w : Logs nonfatal warnings.
e : Logs all error messages.
a : Logs startup of actions.
r : Logs action-specific records.
u : Logs user requests.
c : Logs initial user interface parameters.
m : Logs out-of-memory.
p : Logs terminal properties.
v : Logs verbose output. To use v, specify /L*v.
+ : Appends to existing file.
! : Flushes each line to the log.
* : Logs all information except for the v option. This is a wildcard.

Source: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/msiexec.mspx

Although the Microsoft support page references Windows XP, I have confirmed that this works for Windows 7.

 

From <https://superuser.com/questions/180281/what-folder-are-installation-logs-in>

 

Windows 2000/2003

  1. In the Registry editor, navigate to the following location:

    HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
  2. Under the Installer key, create a String value named Logging.
  3. Edit the value of the string and type in the following:

    voicewarmup
  4. Remove all files from the %temp% directory. The log files default to the location: C:\Documents and Settings\Administrator\Local Settings\Temp
  5. Run the Symantec Mail Security for Microsoft Exchange installer.

 

Windows 2008/Windows 7

 

  1. Start > Run and type gpedit.msc to open the group policy manager.
  1. Expand Computer Configuration -> Administrative Templates -> Windows Components -> Windows Installer.
  2. Select Logging choose the Enabled option box and type voicewarmupx without quotes.
  3. Once you have generated the requested install log, disable the "Logging" option by reversing the steps.

Windows 2012/Windows 8

 

1.Start > Run and type gpedit.msc to open the group policy manager.

2.Expand Computer Configuration -> Administrative Templates -> Windows Components -> Windows Installer.

 

3.Select "Specify the types of events Windows Installer records" choose the Enabled option box and type iwearucmpvox without quotes.

4.Once you have generated the requested install log, disable the "Logging" option by reversing the steps.

 

 

When the installation/uninstallation completes or you see an error message, locate the four (4) MSIxxxxx. log files created in the Temp folder. Send the four MSIxxxxx.log files and the SMSMSExx_Setup.log file to the Symantec Technical Support agent who requested the logs. The default path is:

Windows 2000/2003: C:\Documents and Settings\<Username>\Local Settings\Temp

Windows 2008/Windows 7: c:\users\<username>\appdata\local\temp

NOTE:  You can also use the environment variable %TEMP% in Windows Explorer.

 

Where SMSMSExx_Setup.log refers to the version of the Symantec Mail Security for Microsoft Exchange installed.

 

 

Note: If you install the product remotely, the installation log appears in the Windows\Temp directory.

 

 

 

From <https://knowledge.broadcom.com/external/article?legacyId=tech82257>

 

 

 

Created with OneNote.

Removing tiered storage spaces - Windows Server 2022

As part of the work I have done in my homelab with tiered storage on Server 2022 storage spaces , here is a script I created that allows you...