Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_wordproof_timestamp is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
distrobox: come eseguire più distribuzioni Linux l'una accanto all'altra | IlSoftware.it

distrobox: come eseguire più distribuzioni Linux l'una accanto all'altra

Breve guida all'uso di distrobox, uno strumento completo e versatile che sfrutta i container per caricare ed eseguire tante distribuzioni Linux l'una accanto all'altra, sullo stesso sistema host.

Fino a qualche tempo fa chi voleva sperimentare con Linux, provare distribuzioni, applicazioni, simulare configurazioni da utilizzare poi in produzione, era costretto a utilizzare la virtualizzazione e le macchine virtuali. distrobox apre alla possibilità di usare qualsiasi distribuzione Linux all’interno della stessa finestra del terminale. Ciò è possibile grazie alla creazione di container Docker e Podman, inserendo al loro interno la distribuzione Linux di propria scelta.

Una soluzione come distrobox semplifica enormemente l’installazione e l’esecuzione di molteplici distribuzioni Linux direttamente dal terminale. Ciascun container creato risulta strettamente integrato con l’host, consentendo la condivisione della directory home dell’utente, l’accesso alle unità di memorizzazione esterne, l’utilizzo di dispositivi USB, delle applicazioni dotate di interfaccia grafica (X11/Wayland) e dell’hardware multimediale. L’isolamento (i.e. sandboxing) non è l’obiettivo principale del progetto distrobox che invece mira a rendere le distribuzioni Linux caricate nei container in grado di comunicare con l’host e con le risorse che mette a disposizione.

distrobox è un modo per integrare il software containerizzato come se fosse un’app nativa. Anche se quel software appartiene a una distribuzione completamente diversa. Inoltre, permette di creare ambienti di sviluppo e di test senza richiedere i privilegi di root.

Il concetto generale alla base del funzionamento di distrobox si ispira a toolbox ma ne estende significativamente le abilità puntando a una compatibilità più ampia.

distrobox è un ambiente basato su immagini OCI, utilizzate per creare contenitori che si integrano perfettamente con il resto del sistema operativo. Le immagini OCI (Open Container Initiative) sono un formato standard per la creazione e la distribuzione di container. OCI è un progetto open source che mira a stabilire uno standard aperto e comune per i container, consentendo la portabilità delle immagini tra diverse piattaforme e strumenti.

Come installare distrobox su Linux

Per installare distrobox è possibile fare riferimento ai repository delle varie distribuzioni: sono ormai tante le piattaforme Linux che permettono di caricare direttamente il pacchetto software. In alternativa, basta digitare il comando seguente nella finestra del terminale (inserirlo tutto su una stessa riga):

curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh

Una volta completata l’installazione di distrobox è possibile usare il comando seguente per caricare una distribuzione sotto forma di container. In questo caso richiediamo la creazione di una distribuzione Debian:

distrobox-create --name debian10-box --image debian:10

Il nome può essere scelto in modo arbitrario e specificato dopo --name. Accanto a --image, invece, va specificato il nome della distribuzione Linux da installare. Nella sezione Containers Distros della documentazione di distrobox, in corrispondenza della colonna Image, si trovano i nomi delle immagini da utilizzare nel comando distrobox-create.

distrobox: caricamento distribuzioni Linux container

Il comando che segue consente di accedere al schermata del terminale corrispondente alla distribuzione Linux indicata:

distrobox-enter --name debian10-box

Installare applicazioni all’interno delle distribuzioni distrobox

A questo punto è possibile iniziare a interfacciarsi con la distribuzione Linux di proprio interesse. Ad esempio per installare nuove applicazioni. Nel caso delle distribuzioni Debian e derivate (ad esempio Ubuntu), si può installare Neofetch in questo modo:

sudo apt install neofetch -y

Neofetch è un’utilità basata su riga di comando che mostra informazioni sul sistema: è progettata per fornire una panoramica rapida delle informazioni sul sistema in modo visivamente accattivante. Quando viene eseguito, Neofetch raccoglie diverse informazioni sul sistema, come il nome dell’host, il sistema operativo, la distribuzione Linux, la versione del kernel, le specifiche della CPU, la memoria, la scheda grafica e altre informazioni rilevanti. Queste informazioni sono formattate e visualizzate in modo chiaro e conciso, solitamente sotto forma di un’immagine ASCII art che rappresenta il logo della specifica distribuzione.

Anche l’autore del progetto distrobox, Luca Di Maio, ha utilizzato Neofetch per mostrare quali e quante distribuzioni Linux possono essere caricate e avviate per tramite dei rispettivi container.

È anche possibile eseguire comandi in una specifica distribuzione allestita con distrobox servendosi del comando che segue:

distrobox-enter --name debian10-box -- sudo apt update

In questo modo, non è necessario acquisire prima l’accesso alla shell della distribuzione specificata. Nell’esempio viene disposta l’esecuzione del comando sudo apt update che permette di aggiornare i pacchetti software presenti nella distribuzione.

I comandi utilizzabili con distrobox

Le abilità di distrobox, tuttavia, non si fermano qui. Nella documentazione si trovano l’elenco dei comandi supportati da distrobox.

Tra i più utili c’è distrobox-export, uno strumento che consente di esportare un’applicazione dall’ambiente containerizzato e installarla sul sistema host. La sintassi è semplice: basta digitare il comando distrobox-export --app seguito dal nome dell’applicazione da esportare.

Così facendo, l’applicazione esportata dal container apparirà automaticamente nella lista dei programmi disponibili sul “sistema ospitante”.

Utilissima anche la possibilità di clonare un container: lo si può fare rapidamente con Podman rilevando dapprima l’ID corrispondente (podman ps), arrestando il container (podman stop ID_container) quindi impartendo il comando seguente:

distrobox-create --name debian-10-clonato --clone debian10-box

Nell’esempio, il contenuto del container debian10-box viene automaticamente clonato nel nuovo container di nome debian-10-clonato.

L’immagine in apertura è tratta dalla pagina GitHub del progetto distrobox.

Ti consigliamo anche

Link copiato negli appunti