Marco.C
Posts: 39
Joined: Tue Feb 16, 2016 8:47 pm
Location: Cabo Frio/Rio de janeiro/Brasil
Contact: Website

Raspbian virtual

Mon Apr 20, 2020 5:20 pm

(Text translated by google)

Hello.
First of all, sorry if I put it in the wrong place, if "yes" I ask the help of the admins to transfer ok?

Guys I have a Raspberry Pi 4b with the Raspbian buster (2020-02-13-raspbian-buster) installed on a 32 GB micro sd card for study and testing, I would like to install a second “virtual” Raspbian, maybe even on a USB stick, for studying shell script, studying application installation routines for example, without “getting my main installation dirty, is that possible ?

I found several tutorials that guide the use of VirtualBox or the use of the raspbian desktop, it turns out that the only machine available is this “Rpi 4”, any help ?

Thanks in advance for your attention.

(Texto original)

Ola.
Antes de qualquer coisa, desculpem se coloquei no lugar errado, se "sim" peço a ajuda dos admins para transferir ok?

Pessoal tenho um Raspberry Pi 4b com o Raspbian buster ( 2020-02-13-raspbian-buster ) instalado num micro sd card de 32 gb para estudo e testes, gostaria de instalar um segundo Raspbian “virtual”, talvez ate num pendrive, para estudar shell script, estudar rotinas de instalação de aplicativos por exemplo, sem “ sujar “ minha instalação principal, isso e possível ?

Achei vários tutoriais que orientam o uso do VirtualBox ou o uso do raspbian desktop, acontece que a única maquina disponivel e esse “ Rpi 4 ”, alguma ajuda ?

Desde já, muito obrigado pela atenção.

User avatar
procount
Posts: 2234
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Raspbian virtual

Mon Apr 20, 2020 5:38 pm

1. Why does it need to be "virtual"? Why not just have 2 SD cards with Raspbian on each and swap them when needed?
2. RPi4 does not support booting from USB yet, but we hope it will in the near future.
3. Sakaki has a distro called 'nspawn64' that allows to run a separate 64-bit debian shell within Raspbian. I'm not sure how virtual you need it to be or if debian64 will suffice instead of Raspbian.
4. If you only have 1 SD card, you could install PINN on it, then install Raspbian and a ProjectSpace. Finally replace the ProjectSpace with another copy of Raspbian. You now have 2 copies of Raspbian on the same SD card and you can choose which one to use at boot time.
5. PINN also allows you to easily install 'nspawn64' if you prefer that option.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Marco.C
Posts: 39
Joined: Tue Feb 16, 2016 8:47 pm
Location: Cabo Frio/Rio de janeiro/Brasil
Contact: Website

Re: Raspbian virtual

Mon Apr 20, 2020 6:25 pm

(Text translate by google )

Many thanks for the reply.

I have 2 sd cards, and as I am currently doing, every time I want to test my scripts I am obliged to change the card and by guarantee, I often rewrite the raspbian.

But in addition to shortening the useful life of this card (I think), a lot of work besides spending a lot of time. . So I thought about using a "virtual" raspbian like VirtualBox, I read something about qemu but found it very difficult to use for the little (or no rz rz rz) knowledge I

have. Sorry for using the Portuguese text with translated English copy. through google, my english is also very bad and i'm afraid of not being able to pass on my idea ok?

thanks for the help, any idea will always be welcome.

greetings

( texto original )

Muito obrigado pela resposta.
Eu tenho 2 sd card, e assim que estou fazendo atualmente, cada vez que quero testar meus scripts sou abrigado a trocar o cartão e por garantia, muitas vezes  regravar o raspbian.

Mas alem de diminuir a vida util desse cartão ( acho ), da muito trabalho alem de gastar muito tempo . . .

Por isso pensei em usar um raspbian " virtual " tipo VirtualBox, li algo sobre o qemu mas achei muito difícil usar para o pouco ( ou nenhum rz rz rz ) conhecimento que tenho.

Desculpem por usar o texto em português com copia em inglês traduzido pelo google, meu inglês também e muito ruim e fico com medo de não conseguir passar minha ideia ok ?

Obrigado pela ajuda, qualquer ideia sempre sera bem vinda

Saudações.

epoch1970
Posts: 5564
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Raspbian virtual

Mon Apr 20, 2020 7:12 pm

There is no such thing as a Pi VM.
You can easily run containers on Pi, e.g. with docker or systemd-nspawn
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Marco.C
Posts: 39
Joined: Tue Feb 16, 2016 8:47 pm
Location: Cabo Frio/Rio de janeiro/Brasil
Contact: Website

Re: Raspbian virtual

Mon Apr 20, 2020 8:48 pm

(Text translate by google )

I'm trying this guide https://wiki.arcoslab.org/doku.php?id=t ... emd-nspawn will it work for what I need (test shell script)?
Could someone help me with the command "sudo debootstrap --arch amd64 jessie / var / chroot http://ftp.us.debian.org/debian/",
want to try to use the file "2020-02-13-raspbian-buster.img" that is in "/ home / pi / Desktop / SYSTEMS"?
Thank you very much

( texto original )

Estou tentando esse guia https://wiki.arcoslab.org/doku.php?id=t ... emd-nspawn sera que daria certo para o que preciso ( testar shell script ) ?
Alguem poderia me ajudar com o comando " sudo debootstrap --arch amd64 jessie /var/chroot http://ftp.us.debian.org/debian/ ",
quero tentar usar o arquivo " 2020-02-13-raspbian-buster.img " que esta em " /home/pi/Desktop/SISTEMAS "
Muito obrigado

User avatar
Botspot
Posts: 1449
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Raspbian virtual

Mon Apr 27, 2020 9:28 pm

Marco.C wrote:
Mon Apr 20, 2020 5:20 pm
I would like to install a second “virtual” Raspbian, maybe even on a USB stick, for studying shell script, studying application installation routines for example, without “getting my main installation dirty, is that possible ?
Wow, this is exactly what Pi Power Tools was designed for!
See: https://github.com/Botspot/Pi-Power-Tools

(I've tried to write the below text translator-friendly)
Pi-Power-Tools is an application I made. It is designed to customize Raspbian .img files.
img-mode.png
img-mode.png (21.47 KiB) Viewed 167 times
In this picture, you can see a button called Boot. When I click Boot, it starts a virtual machine of the selected raspbian img file. (actually it uses systemd-nspawn to boot a container, so it's slightly different than a virtual machine)
I can even run Raspbian Stretch inside of Raspbian Buster!
Image
This link explains more about the Boot button: https://github.com/Botspot/Pi-Power-Tools#boot
To install Pi Power Tools, put this in a terminal:

Code: Select all

wget -O - https://raw.githubusercontent.com/Botspot/Pi-Power-Tools/master/update | bash
Want to run Zoom on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes the full version of Minecraft, Chromium Media Edition, Pi Power Tools, an automated email checker, and 16 other useful programs not in the repos.

Return to “General discussion”