Visualizzazione post con etichetta macOS. Mostra tutti i post
Visualizzazione post con etichetta macOS. Mostra tutti i post

martedì 7 maggio 2024

Always Trust Certificate on Microsoft RDP for MAC

Issue


After updating my macOS to Sonoma 14.4.1 (23E224) I can no longer connect to Windows machines via "Microsoft Remote Desktop" version 10.9.6 (2188).

I click on the remote connection, and then "Continue" as usual....
... the connection change into connecting state, but it hangs ...
... and no connection will be established to the remote PC.

Solution


Open the connection, then click "Show certificate" and expand "Trust"
change options from "Use System Defaults" ...
... to "Always Trust".
Confirm the changes by entering the system password ... and click continue to establish the remote connection.
If it doesn't work right away. Close the "Microsoft Remote Desktop" application, reopen it and try connecting again. It should work without even showing the certificate.

That's it.

venerdì 31 marzo 2023

How to create an ISO image from a folder on MAC

Issue


How to create an ISO image from a folder on MAC ??

Solution


Lately I have the need to create ISO images to attach as CDROM to the VMs.
I put all stuff I need inside the folder and then I create the ISO image. To do that on MAC is quite easy, you don't need any added software to install. We can use the command "hdiutil".

Open a terminal and type :
hdiutil makehybrid -o image.iso ./folder -iso -joliet 
Replace the 'image.iso' with the name of the iso that you want to create and './folder' with the directory you want to convert into an ISO image.
The folder path can be relative (as in my case) or absolute.

Hit enter.

That's it.

martedì 11 ottobre 2022

MacOS - Running Scripts at Login

Issue


In October 2018 I wrote a short post (in Italian) on how to "Remapping Keys in MacOS".
In the post I also wrote that I would publish a second one on how to make this change permanent. For reasons of time (few time available), work, family, etc. I never managed to write it until I forgot about it. Then thanks to Paolo's comment I remembered that I have not posted it anymore. So, I do it now.

Solution


To solve this issue, and make the fix permanent every time I login into my account I decided to use the LaunchAgent features.
More information about LaunchAgent can be found in "Daemons and Services Programming Guide" and in "Script management with launchd in Terminal on Mac" as well.

Let's see below how to run the script when our user logon.
  1. Let's start, creating the folder where to place the script to run. In my case I decide to create a new ".lm_scripts" (hidden folder) under my own directory.
  2. Create a script similar to the followingg, and place it under the new directory (in my case .lm_scrpts).
    For a complete reading on how to find the various parameters, refer to my original post
    #!/bin/bash 
        
     hidutil property --matching '{"ProductID":0x221,"VendorID":0x5ac}' --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000063,"HIDKeyboardModifierMappingDst":0x700000037}]}'
  3. Give the script executable permissions
    chmod +x remapping.keys.sh
  4. Create with your favourite editor a new .plist file. I called it com.remapping.keys.plist
    As shown below
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
            <key>Label</key>
            <string>com.remapping.keys.app</string>
            <key>Program</key>
            <string>/Users/lorenzo/.lm_scripts/remapping.keys.sh</string>
            <key>RunAtLoad</key>
            <true/>
        </dict>
    </plist>
    Note that, the program string above must reflect your user and the path where the script remapping.keys.sh is present.

  5. Then, place the file, in my case com.remapping.keys.plist (just created) under the following directory ~/Library/LaunchAgents/

Now, at your next login the keys of the keyboard keys will be re-mapped as desired.

That's it.

mercoledì 10 febbraio 2021

How to easily install VCSA from MacOS

Issue
Today I needed to install the new vCenter server 7.0u1. I downloaded the .iso (VMware-VCSA-all-7.0.1-17327517.iso) file from VMware, double click on the file, then I navigated inside and clicked the file Installer, present under the folder vcsa-ui-installer/mac/.

After that I faced the gatekeeper of the mac (Bug Sur 11.2). In order to proceed with the installation of it had to allow each step. Until, even if I was allowing it to continue, I was no longer able to proceed and the installation was stuck in here....

Solution
Googling around I found how to disable macOS gatekeeper only for a specific folder. I also found an article from William Lam on "How to exclude VCSA UI/CLI Installer from MacOS Catalina Security Gatekeeper"

However, for the installation I proceeded as follows ..
  • I created a new folder namde VCSA (in my case).

  • I copied/extracted all the files into the new VCSA folder ..



  • Opened a new MacOS Terminal

  • Moved into the proper folder, launch the command xattr as shown below in order to remove the metadata "com.apple.quarantine" for the extracted VCSA ISO files

    lorenzo@MacBook-Pro Downloads % sudo xattr -r -d com.apple.quarantine VCSA
  • After the quarantine attribute has been removed, it is possible to run the VCSA UI Installer without being prompted with an error.

  • However it could happen that the installation path is not correctly detected (as in the image below).

    Click on Browser and select the folder VCSA (in my case) the ones with the quarantine metadata removed.

  • It is now possible, to continue with the installation and proceed over ...

    ....until the end.

That's it.

martedì 18 giugno 2019

USB to Serial from MAC

Mi capita di dover utilizzare il connettore USB-to-Serial sul MAC e non ricordarmi i comandi per attivare la visualizzazione dal terminale.
In linea di massima non è necessario installare del software aggiuntivo sul MAC per farlo funzionare, diamo quindi per scontato qual ora fosse necessario che sia installato e correttamente funzionante.
Di seguito i passi:
  1. Aprire una sessione Terminal

  2. Ricerchiamo il device TTY corretto in /dev. Digitando: ls -l /dev/cu.*


    Nel mio caso il risultato è "/dev/cu.usbserial"

  3. Connettiamoci, utilizzando il comando:
    screen /dev/cu.usbserial <baud rate>


    Nel mio caso screen /dev/cu.usbserial 115200


    That's it.

Maggiori dettagli sull'utilizzo del comando screen, possono essere ottenuti dal Terminal digitando man screen.

sabato 13 ottobre 2018

Remapping Keys in macOS

Problema
Utilizzo quotidianamente, sia per scopi lavorativi che personali un MAC Book Pro. Quando sono in ufficio mi capita spesso di connettere schermo e tastiera USB (APPLE Magic Keyboard + Tastierino numerico) esterni come quella mostrata qui.


Con altrettanta frequenza mi capita di utilizzare il tastierino numerico per digitare indirizzi IP. Ma forse per pigrizia, ho sempre digitato dal tastierino i numeri e mai il "." (punto). Questo perché nel tastierino numerico come possibile vedere sotto è presente la "," (virgola).



Soluzione
Ho pensato quindi a come poter ri-mappare solo quello specifico tasto e non l'intero layout della tastiera.
La soluzione l'ho trovato nella technote "Remapping Keys in macOS 10.12 Sierra" di apple TN2450.
Per far funzionare il tutto bisogna procedere come indicato sotto. Da tenere presente che la modifica è temporanea e, ad ogni riavvio le impostazioni vengono perse (in futuro vediamo come rendere permanente questa modifica).
La soluzione è stata testata su di un ambiente macOS Mojave Versione 10.14.
  1. Apriamo un "Terminal"

  2. Procediamo con il verificare la lista dei device riconosciuti dal sistema ..digitando hidutil list


  3. Come possiamo vedere, la tastiera esterna è identificata dalla seguente stringa "Apple Keyboard"

  4. Prendiamo nota del ProductID (nel mio caso "0x221") e del VendorID (nel mio caso "0x5ac")

  5. Prendiamo nota dal link della Technote Apple dello "Usage ID (hex)" che corrisponde alla "," del tastierino alla riga "Keypad . and Delete" che corrisponde a "0x63".

  6. Prendiamo nota anche del carattere che vogliamo impostare al posto del tasto identificato alla riga "Keyboard . and ">"" con il UsageID che corrisponde a "0x37".

  7. Non ci resta che lanciare la seguente stringa da terminale ... e verificarne il funzionamento.

    LIF:~ Lorenzo$ hidutil property --matching '{"ProductID":0x221,"VendorID":0x5ac}' --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000063,"HIDKeyboardModifierMappingDst":0x700000037}]}'


  8. Funziona!!!!

  9. Se vogliamo ritornare alle impostazioni originali lanciare il comando:

    LIF:~ Lorenzo$ hidutil property  --set '{"UserKeyMapping":[]}'

  10. Per verificare le impostazioni lanciare il comando:
    LIF:~ Lorenzo$ hidutil property  --get "UserKeyMapping"


Prossimamente scrivorò, come fare in modo di attivare questa mappatura al ricnoscimento della tastiera, rendendolo permanente.

lunedì 11 giugno 2018

MAC - Installare PowerCLI

Nel precedente post abbiamo installato la "PowerShell" su mac, siamo quindi pronti per poter procedere con l'installazione della PowerCLI VMware.

Apriamo il terminale ed accediamo alla PowerShell digitando:

LIF:~ Lorenzo$ pwsh

Possiamo procedere con l'installazione della PowerCli VMware semplicemente digitando:

PS /Users/lorenzo> Install-Module -Name VMware.PowerCLI -Scope CurrentUser  

e confermare con "Y" per procedere con il download e l'installazione dei vari moduli..... per verificare che siano stati correttamente installati lanciare il comando ...

PS /Users/lorenzo> Get-Module -Name VMware.* -ListAvailable

Tutto sembra essere stato installato correttamente. Siamo pronti per poter utilizzare la PowerCLI su nostro macOS.


Alcuni link utili: 
https://ithinkvirtual.com/2018/03/04/install-powershell-and-vmware-powercli-on-centos/
https://blogs.vmware.com/PowerCLI/2018/03/installing-powercli-10-0-0-macos.html
https://notesfrommwhite.net/2018/02/28/installing-powershell-powercli-on-a-mac/



MAC - Installare PowerShell Core

Abbiamo precedentemente installato il tool (homebrew) necessario per procedere con l'installazione della PowerShell Core come indicato da documentazione Microsoft.

La successiva componente che dobbiamo installare per poter installare PowerShell e successivamente la PowerCLI, è Homebrew-Cask. Procediamo come indicato di seguito:


LIF:~ Lorenzo$ brew tap caskroom/cask


e continuiamo con l'installare la PowerShell

LIF:~ Lorenzo$ brew cask install powershell

Se tutto è andato correttamente ....



Verifichiamo che tutto funzioni correttamente lanciando il comando ...

LIF:~ Lorenzo$ pwsh

Come possiamo vedere la PowerShell installata in questo caso è la v6.0.2, tuttavia per avere maggiori dettagli sulla PowerShell installata possiamo digitare direttamente dal prompt della pwsh:


PS /Users/lorenzo> $PSVersionTable 


Verifichiamo i moduli installati di default 

PS /Users/lorenzo> Get-Module * -ListAvailable




Nel prossimo post procederemo con l'installazione della PowerCli VMware.

venerdì 8 giugno 2018

MAC - Installare Homebrew

Problema
Ho la curiosità e la necessità di installare "PowerShell" e la PowerCLI VMware su macOS.

Soluzione
Per prima cosa (come prima componente), se non presente nel proprio sistema, installare Homebrew. Homebrew è una delle soluzioni più diffuse su macOS per la gestione dei pacchetti.

L'installazione è molto semplice si tratta di aprire un "Terminale" e di lanciare il comando riportato sotto...

LIF:~ Lorenzo$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Procedere premendo Invio


Inserire la password e premere Invio per continuare 




Sembra che tutto si sia installato correttamente (Installation succesful). Possiamo procedere con l'installazione della PowerShell Core.