Showing posts with label Microsoft Windows 10. Show all posts
Showing posts with label Microsoft Windows 10. Show all posts

Sunday, May 19, 2024

VirtualBox Hosting Multiple Linux Installs

Broadcom recently announced that a personal license of VMWare Workstation Pro is now free. The commercial version has a price. For those people who use VMWare at work, a free home version may be useful.

Oracle has provided the base version of VirtualBox for free for several years. The source code is available under the GNU licensing scheme. 


Let's install a virtual machine using VirtualBox from Oracle. This example uses a host Microsoft Windows 10 Pro build 19045. There are 24 GB of memory and storage is a 2 TB SSD. The "guest" virtual machine will be a version of Ubuntu Linux. This example uses drive L: for virtual machine files.


Explanations and definitions:

  • The physical PC running VirtualBox and has the virtual machines (VM) running on it is called the host. Virtual machines are called guests.
  • VirtualBox Manager GUI may be thought of as the main VirtualBox window, where you can start and stop and reconfigure guest VMs. Once guest VMs are running, the VirtualBox Manager GUI does not need to continue to run and can be stopped and restarted without affecting guest VMs.
  • The GUI windows that show the guest operating systems are the "guest windows". There are options to start VMs as "headless" without the windows.

Learning resources and downloads are available at:

www.virtualbox.org

docs.oracle.com/en/virtualization/virtualbox/7.0/user/Introduction.html

www.virtualbox.org/wiki/Downloads



The install will need C++, which may be found here. "Microsoft Visual C++ Redistributable latest supported downloads".

 

Virtualization must be enabled in the BIOS settings of the PC. Check this now by rebooting machine, press the proper function key to setup BIOS, and look in the BIOS menus.

Before running the VirtualBox installer, consider these two items:

  • If you don't write Python scripts then you don't need to install Python. The guest VMs will be full operating systems and should have support for whatever you normally use in that operating system. For example, Ubuntu Linux includes the typical tools and scripting such as Python. We will not install Python scripting support. 
  • If you are using a Standard User account, there is a prompt for Administrator access to run the installer. You will likely want to use a non-Administrator Standard Account in MS Windows, because the later steps of installing and configuring VMs can use the Standard User account permissions instead of using a MS Windows privileged Administrator account for daily VirtualBox tasks.


Download the VirtualBox installer. Run the VirtualBox installer. This example used installer "VirtualBox-7.0.18-162988-Win".


Run the VirtualBox installer. 


















Click Yes at the warning about adding a network interface.










Click install. The installer runs for less than a minute.

After the installer completes, the new network interface "VirtualBox Host-Only Ethernet Adapter", will be visible.




















Let's create a new virtual machine. 

Start the VirtualBox Manager application and click New. 










Pick a name for the machine, an OS and version, and location to store files. This machine name is going to be the hostname when inside Ubuntu Linux.








The OS version choices are often slightly behind OS releases from the vendor. For best compatibility, choose an OS version which is displayed in the "Create Virtual Machine" dropdown. It is typically good to choose a long-term support version, such as "Ubuntu Server 22.04.4 LTS". 

Download the corresponding ISO file from the OS vendor. For this example, choose a server version at the Ubuntu download website.


Set the amount of memory and number of CPUs.








Set the disk space. For testing or home use, it is not necessary to pre-allocate the drive space. For production systems with high uptime requirements on hosts with shared storage, it is often good to pre-allocate disk space to remove a potential problem. Not pre-allocating disk space will allow for reduced backup sizes.








On the screen "Unattended Guest OS Install Setup", set the username, machine name, and passwords. Username is going to be what you log in as on the Ubuntu Linux console, so maybe choose "admin" or "install". Chapter 3 "Configuring Virtual Machines" has an explanation of the choices.








Press Next. Review the Summary page and press Finish. 









The new VM will be created and will try to start.









There were several issues while trying to start the VM. The issues were centered around hypervisor memory access and appeared as "VERR_NEM_NOT_AVAILABLE" and "VT-x Is Not Available (VERR_VMX_NO_VMX)".









Press MS Windows Start button and type "cmd" to start a command prompt as Administrator. Then configure MS Windows hypervisor in the command prompt as Adminstrator:

bcdedit.exe /enum {current} | find "hypervisorlaunchtype"

bcdedit /set hypervisorlaunchtype off



Press the MS Windows Start button and type "windows features". Click on "Turn Windows features on or off". There will be a prompt for the Administrator password.  











Install two features "Hyper-V" and "Windows Hypervisor Platform".




















Press the Start button in MS Windows and type: core isolation









Turn off core isolation memory integrity then reboot the machine.



After rebooting, run the VirtualBox Manager application. Highlight the VM name which previously failed to start and press the Start button. If it does not start there is more troubleshooting to do.

When the VM is running the configuration can be seen in the VirtualBox Manager. Choose Settings --> System. It is not possible to dynamically change settings such as CPU count or memory. These settings can be changed when the VM is not running. 










This shows increasing the number of CPUs when the VM is not running.


Start the virtual machine. In the VM window log in to Linux. 

From the Linux command line, run command: htop 

The htop command is typically installed with Ubuntu server, though not with the desktop version of Ubuntu.











Notice there are 4 CPUs (which are typically numbered 0 through 3).


Let's do a quick stress test on the VM. In MS Windows, run the Task Manager to monitor machine usage. On the Linux command line, run a couple commands to stress the CPU and disk. Type the following lines which are after the "$" prompt. The next line with the loop should have numbers up to the VM configured CPU count.

$ for loop in 1 2 3 4; do while : ; do : ; done & done

# Run htop or top or uptime.
$ cat /dev/random > /tmp/testing 

# In the host operating system MS Windows, look in Task Manager.
# Find the process ID numbers to kill to stop the stress testing.
# Look in "top" or run the next line.
$ ps -fu 

# Choose the PIDs for the stress tasks.
# (Use your own PIDs for the next line.)
$ kill 1034 1035 1036 1037 1055

On the Linux command line, shutdown Linux.

$ shutdown

In a minute, VirtualBox Manager GUI should recognize the VM exiting and set status to "Powered Off". You will see in the host machine performance monitoring (Task Manager in MS Windows) that memory used by the VM has been freed. 


The prior example used a "server" version of Linux which did not have a desktop GUI. Installing the desktop version of Ubuntu Linux is a similar process. At the Ubuntu website, download the ISO image to correspond with an image which is pre-populated in the VirtualBox Manager GUI. You may need to go to the Ubuntu past releases downloads.

If you try to use the latest Linux version which is not in the pre-populated list you may encounter an error. 









Run the VirtualBox Manager GUI and press the New button.

In a graphical Linux window, the "Welcome to Ubuntu" screen will be shown. 










After the install completes, log in.











Log in and you will see the graphical desktop. Skip the prompt for adding online accounts.











If there are annoying wave patterns across the GUI display, in the Ubuntu Linux desktop go to Settings --> Displays and adjust the Resolution and Refresh Rate to common values such as 1024 x 768 and 60 Hz. Settings is the gear icon on the left of the graphical desktop.





Sunday, September 24, 2023

How To Install Photos Legacy, and Microsoft Windows App Store

Microsoft is upgrading well-known apps such as Paint and requiring an app store download to install the legacy Paint app. For those with MS Windows login accounts not using an email address, using the Microsoft app store will encounter issues. It appears Microsoft is focused on forcing installs from their app store, along with sign-in via an email address.

A couple apps you may want to download from the app store are Paint Legacy and Power Tools. In a web browser, login to a Microsoft email address such as a Hotmail account. Then go to the web version of the app store and search for your app. Then click button "Get in Store App" and it may download and install. This can avoid using the app store app which is now built in to MS Windows.


After logged in to a Microsoft account on web browser (to hotmail.com or live.com or other Microsoft email hosting), use the following links:
  • MS Photos Legacy     ( https://apps.microsoft.com/store/detail/microsoft-photos-legacy/9NV2L4XVMCXM )
  • MS PowerToys     ( https://apps.microsoft.com/store/detail/microsoft-powertoys/XP89DCGQ3K6VLD )

The download window claims there are in-app purchases available in the Photos Legacy app.













Be aware that Power Toys will add items to context menus such as File Explorer.

Monday, July 17, 2023

File History in Microsoft Windows

Microsoft Windows File History is a type of backup will periodically copy files to another location or another computer. If you lose the files, you can restore from the backup copies. The backup copies will be saved at a destination file store location. The destination location is often a network drive or on a locally attached USB drive which can be quickly removed each evening. A locally attached hard drive on the same machine does not provide geographic redundancy like a network drive, though it can be used to provide file backups. This post describes how to set up File History in Microsoft Windows 10. 


This first example uses a locally attached drive (because it is straightforward to set up local drive is without potential networking issues). The second example will use a network drive.

To set up File History, begin by ensuring you have access to the network share. In File Explorer, open the network share. If prompted for login, enter the login information and check the box for "Remember my credentials".

























Next, open the Backup application. If the app is already running, close it and re-open it. Press the MS Windows Start button and type: backup settings
Choose the Backup application.





















Choose "Add a drive". 
For this example, drive D: is chosen.




















The blue text of "More options" will allow configuration on how often to back up and how long to store backups. Many people will set "Keep my backup" to "Until space is needed".


















Under "Back up these folders" choose "Add a folder" and choose a folder. When your folder choice is visible, click on it. You may want to remove some of the folders, such as "Saved Games" or "Favorites". This example will back up the personal music directory. 























Press "Back up now" and the file history backup will begin.

Press the back arrow to confirm "Automatically back up my files" is set to on. 























Press "More options" to go to the "Backup options" screen to learn when the initial backup is complete. This shows the backup is in process with "Backing up your data...".























You may want to use File Explorer to go to the backup drive and confirm a new folder was created with your Windows PC user name and machine name.



In case the PC is destroyed physically or by malware, it will be useful to have File History backups stored on a network drive away from the primary machine. In general, File History configuration is the same, though networking must be properly configured. Occasionally an issue is encountered with the network share.

This example uses the network resource with name NASIX. Confirm you have credentials to access the network share by clicking on the network share or by typing the share name in File Explorer as: \\share-name
























The following error message was displayed. This is somewhat confusing in that the network resource appears to be available in Windows File Explorer, yet an error is encountered when attempting to open the resource even before a logon or credential is requested. You may try the "Diagnose" button.










In this example, the error message "Windows cannot access \\sharename" may require several steps to troubleshoot. If you do not have an error connecting, you may skip over this troubleshooting section.
First, log on to the actual network device an ensure it is properly shared. Next, open the Windows PC, open a command prompt by pressing Start button and type: cmd

In the following "net use" example, "z:" can be any available letter and "nasix" is the name of your network share. In the command prompt, type the following: net use z: \\nasix

You may encounter system error 51 or system error 53 such as, "System error 53 has occurred. The network path was not found." 
  • Ensure the necessary networking components are installed and are running. Open "features" from the Start button to open "Optional features". 
  • Clear out any old credentials for the resource. Press Start button and "credential manager". Click on Windows Credentials and remove any out-dated credentials.
  • Ensure the SMB client is installed. Open "services.msc" from the Start button and ensure the "Network Connections" is started. 
  • Open the old control panel app from the Start button, type "control panel", choose "Network and Internet", "View network computers and devices".
  • Also in the old control panel app, search for "sharing" and choose "Manage advanced sharing settings" then confirm network discovery and file sharing are turned on. Double-check all of the discovery and sharing options.
















If none of this fixes the system error 53 problem, it may be useful to add a key to the Registry. Tampering with the registry may cause significant problems and may affect future software upgrades in surprising ways. Make a note of what you change in the Registry so you may remove it if necessary.
Press the Start button and type "regedit". Choose Registry Editor. On the left pane, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters and add a key named AllowInsecureGuestAuth as DWORD 32-bit. Set the value to 1. In File Explorer, try to open the network resource. 



Logs for File History may be found in the Event Viewer at %SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-FileHistory-Engine%4BackupLog.evtx

File History settings are also available in the older Control Panel app, at Control Panel\System and Security\File History








Sunday, March 19, 2023

Who Needs the Optional Features in Microsoft Windows

Minimizing the applications and services on your computer can help to reduce the hacker attack service. If an app or service does not exist and can not be started, then it can not be exploited. The consumer desktop version of Microsoft Windows is good at keeping backward compatibility. This unfortunately leads to increasing hacker attack service and bloated installations.

Microsoft Windows 10 can remove some of the unneeded software. In this example, we will remove the .Net Framework.


The command prompt command "systeminfo" shows the following:

OS Name:                   Microsoft Windows 10 Home
OS Version:                10.0.19045 N/A Build 19045

Before starting, please create a restoration point in case you want to undo the changes. Press Start button, type "restore", choose Create A Restore Point.


On the desktop, press the Start button then press the Settings icon (the gear).

In the Windows Settings, choose Apps and click Optional Features. This may request the administrator prompt, which is required to continue.

Click on Optional Features.



Scroll down and click More Windows Features. 



This will display the Windows Features box. 



Deselect .NET Framework. 



Press OK and apply the changes.



Reboot to finish the changes.





Saturday, February 04, 2023

Hide Icons On Microsoft Windows Desktop

Anyone updating applications may notice that links to start the app often appear on the desktop. While these can often be easily deleted, if they are instead hidden then the next time the app is updated the link is likely to remain and stay hidden.

Microsoft has been pushing icons and shortcuts to the desktop. A recent Windows 10 patch rollup put a Microsoft Edge icon on the desktop, and it requires administrator privilege to remove it. 






Regular users can hide the icon with a quick command window. Bring up the command prompt by pressing Start button, type cmd, and press the Command Prompt app.

In the command prompt window, go to the desktop folder by typing:
cd desktop

Look for the file with the directory command and a flag:
dir /A

If the file does not exist, it may be in the Windows public profile. On the desktop, right-click on the icon, choose Properties, press the Details tab, and look where the actual link is located. If it is in the public profile you will need an administrator to help you.

If the file exists in your profile, you may set the hidden attribute on the filename for the icon to make it disappear:
attrib +h Microsoft*.lnk















The desktop should now be less cluttered with the icon hidden.











If the lnk file is in the Windows public profile and you can become adminstrator, then start the command prompt as administrator. Go to the directory and set the hidden flag:
C:\Users\Public\Desktop> attrib +h Microsoft*.lnk

Sunday, January 02, 2022

Tar and Curl in MS Windows 10

I wanted to scp a deep directory structure to a unix machine. In MS Windows 10, I tried to use the File Explorer to click once on the directory and right-click to use the SendTo and choose "Compressed (zipped) folder". That did not work and there was no error message. It simply failed silently.

I opened a PowerShell and found, to my surprise, that both curl and tar are now in Windows 10. To put directories and files into one larger file, the tar command may be used. By itself tar does not compress, though it put everything into one file to make it easier to take a snapshot of a directory structure.

The basics of tar on MS Windows 10 is to open a PowerShell window. Navigate to the top of the directory structure. Type:
tar -cf filename1 filename2 directory3 directory4 newTARfilename.tar

If you want to have ongoing feedback from the command, add the verbose flag:
tar -cvf filename1 filename2 directory3 directory4 newTARfilename.tar

This example uses PowerShell and shows the tar help, the directory, and the tar command.

PS C:\temp\showcompress> tar /?
Usage:
  List:    tar.exe -tf <archive-filename>
  Extract: tar.exe -xf <archive-filename>
  Create:  tar.exe -cf <archive-filename> [filenames...]
  Help:    tar.exe --help
PS C:\temp\showcompress> dir


    Directory: C:\temp\showcompress


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2021-12-29     15:59                DecemberFolder


PS C:\temp\showcompress> tar -cf DecemberFolder.tar DecemberFolder
PS C:\temp\showcompress> dir


    Directory: C:\temp\showcompress


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2021-12-29     15:59                DecemberFolder
-a----        2021-12-30     00:22    39059677696 DecemberFolder.tar






















You may also want to explore the Compress-Archive command in Powershell.


An example curl command will look like:

C:\>curl 2600.com
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://2600.com/">here</a>.</p>
</body></html>

Tuesday, December 14, 2021

Remove Apps From MS Windows 10

Microsoft is push-installing many more applications in Windows 10. A user may remove some applications by clicking the Start button then right-click on an app and choose uninstall. The uninstall option is not available for many apps installed by Microsoft.

This list of MS Windows 10 PowerShell application removal lines can work on some versions of Windows, and may depend on the current naming and the build number of Windows. The following were tested on several versions of Windows 10, including Microsoft Windows 10 Pro version 10.0.19043 N/A Build 19043.

Right-click on the Start button and choose: Windows PowerShell

If you are not able to run PowerShell as administrator in order to remove the application packages for all users, you will receive an error:
Get-AppxPackage : Access is denied.
Access is denied.


You may instead run the following commands without this option: -Allusers
If the following commands are not working with "-Allusers", try do remove that and run the command again.


If you are looking for application package names to install, try this example for the Solitaire game:
> Get-AppxPackage | select-string  "solitaire"

Microsoft.MicrosoftSolitaireCollection_4.4.8204.0_x64__8wekyb3d8bbwe

Then use "solitaire" and remove the game:
Get-AppxPackage *solitaire* | Remove-AppxPackage



List of what you may want to remove. If you are not logged in as administrator, remove "-AllUsers" from the following:

Get-AppxPackage Microsoft.YourPhone -AllUsers | Remove-AppxPackage
# or
Get-AppxPackage *windowsphone* -AllUsers | Remove-AppxPackage


Get-AppxPackage *xbox* -AllUsers | Remove-AppxPackage


Get-AppxPackage *3dbuilder* -AllUsers | Remove-AppxPackage

Get-AppxPackage Microsoft.Microsoft3DViewer -AllUsers | Remove-AppxPackage


Get-AppxPackage *people* -AllUsers | Remove-AppxPackage
# or
Get-AppxPackage Microsoft.Windows.PeopleExperienceHost -AllUsers | Remove-AppxPackage
# or
Get-AppxPackage Microsoft.people -AllUsers | Remove-AppxPackage


# Cortana
Get-AppxPackage Microsoft.549981C3F5F10 -AllUsers | Remove-AppxPackage

Get-AppxPackage *Microsoft.GetHelp* -AllUsers | Remove-AppxPackage

Get-AppxPackage *windowsalarms* -AllUsers | Remove-AppxPackage

Get-AppxPackage *windowscommunicationsapps* -AllUsers | Remove-AppxPackage

Get-AppxPackage *skypeapp* -AllUsers | Remove-AppxPackage

Get-AppxPackage *officehub* -AllUsers | Remove-AppxPackage

Get-AppxPackage *getstarted* -AllUsers | Remove-AppxPackage

Get-AppxPackage *onenote* -AllUsers | Remove-AppxPackage

Get-AppxPackage *bingweather* -AllUsers | Remove-AppxPackage

Get-AppxPackage *windowscamera* -AllUsers | Remove-AppxPackage

Get-AppxPackage *windowsmaps* -AllUsers | Remove-AppxPackage

Get-AppxPackage Microsoft.WindowsFeedbackHub -AllUsers Remove-AppxPackage

Get-AppxPackage *music* -AllUsers Remove-AppxPackage

Get-AppxPackage *solitaire* -AllUsers | Remove-AppxPackage

Get-AppxPackage *portal* -AllUsers | Remove-AppxPackage

Get-AppxPackage *stickynotes* -AllUsers | Remove-AppxPackage

# Movies & TV

Get-AppxPackage *zunevideo* -AllUsers | Remove-AppxPackage

# Snip & Sketch
Get-AppxPackage *screensketch* -AllUsers | Remove-AppxPackage

# Sound Recorder
Get-AppxPackage *soundrecorder* -AllUsers | Remove-AppxPackage


Microsoft OneDrive may be removed from within the legacy "Control Panel" application. Press Start button, then begin typing "control panel".


After you have uninstalled applications, it is usually useful to create a Windows "restore point" to snapshot the current configuration. If you feel more advanced, you may want to explore the "Services" app to stop services you may not be using.

Monday, October 18, 2021

Disable Windows 10 Search Advertising

This post covers two topics which are similar though separate - File Explorer search box suggestions; and Start Button search advertising.

 

In Windows 10, the File Explorer shows suggestion pop-ups when you begin to type in the File Explorer search box. While tolerable, it becomes annoying if you frequently search. If you prefer for the File Explorer search box to return search results after you are done typing, the search pop-up functionality may be disabled.


If you have a Windows 10 version with group policy editor, press the Start Button and type: gpedit Run the Edit Group Policy application as administrator. In the group policy editor, go to User Configuration, Administrative Templates, Windows Components, File Explorer.
 



Edit the entry for "Turn off display of recent search entries in the File Explorer search box". Choose "Disabled" and press OK button.


The setting should now be Disabled.


 



A separate issue with Windows 10 is invasive keystroke monitoring and advertising. Press the Start Button and begin to type a program name or file name. Windows 10 will show matching program names, file names, and also provide search engine results. This is like a mini search engine in the Start Button based on your typing and geo-location. If you type "burgers", not only will it search for local programs and files named "burgers", but you will also get a review of where to locally purchase burgers and a map for local burger shops. Microsoft calls this feature Web search.  Many people call it "intrusive and annoying". There does not appear to be an intuitive and easy way to turn off this advertising.

 
This feature can be turned off with the registry editor. Press the Start Button and type: regedit
Run the Registry Editor application as administrator. The registry key will include Computer\HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows. (While it may appear the key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer can configure this for all users, it doesn't seem to work.)
Confirm this registry key exists, or add it: Computer\HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer

Right-click on the "Explorer" key, and add a new DWORD 32-bit value with name: DisableSearchSuggestions


Set the value to 1.


Reboot the computer and test that the Start Button advertising functionality has been disabled.