Sunday, September 29, 2024

Remove Android Apps with ADB

Many pre-installed Android apps can not be easily removed within the phone app store. With a PC you can remove unwanted apps.

On phone, enable developer mode. Open the Settings app on phone and scroll down to About Phone, Software Info. Tap on the Build Number seven times to enable Developer Options.
On phone in Settings app, enable USB Debugging.


 

 

 

 

 

 

 

 

 

 

 

Plug the phone into PC with USB cable.

On MS Windows, download Google's adb tools from https://dl.google.com/android/repository/platform-tools-latest-windows.zip

Unzip the file.

Open MS Windows PowerShell.

In the PowerShell window, cd into the downloaded directories. 

In the PowerShell window, run: ./adb devices

The phone device is listed with status "unauthorized". Phone can not yet be accessed from PC.



 

 

 

 

 

 

 

On the phone there should be a prompt to allow connection to PC. Press Allow.


 



 

 

 

 

 

 

 

 

In the PowerShell window, again run: ./adb devices




 



After running the next command to enter the shell, the remainder of commands in this example will be run within the shell. In the PowerShell window, run: ./adb shell

    pm list packages


 




 

 

 

 

You may want to copy the list of packages to a text editor for review. 

Let's remove the weather apps.
    pm list packages | grep weather
acexlm:/ $ pm list packages | grep weather
package:com.lge.sizechangable.weather.platform
package:com.lge.sizechangable.weather.theme.optimus
package:com.lge.sizechangable.weather


 



 

 
Uninstall each entry:
    pm uninstall -k --user 0 com.lge.sizechangable.weather.platform
    pm uninstall -k --user 0 com.lge.sizechangable.weather.theme.optimus
    pm uninstall -k --user 0 com.lge.sizechangable.weather


 

 



 

On the phone please refresh the list of apps. Notice the weather apps are listed as "Not installed".


 

Remove a few other apps. Notice the shell command "pm list packages" is used with flag "-f" instead of a pipe to "grep".


The older Google Duo app is "tachyon":
acexlm:/ $ pm list packages -f tachyon
package:/product/app/Duo/Duo.apk=com.google.android.apps.tachyon
acexlm:/ $ pm uninstall -k --user 0 com.google.android.apps.tachyon
Success


 


 

 


Remove Google Pay:
acexlm:/ $ pm list packages -f wallet
package:/system/app/GooglePay/GooglePay.apk=com.google.android.apps.walletnfcrel
acexlm:/ $ pm uninstall -k --user 0 com.google.android.apps.walletnfcrel
Success


 


 

 

 

Restart the phone and check for functionality.

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.