Ceci est une ancienne révision du document !
I was talking to a friend who is stuck in a dead end sales job, about learning the basics of code, so he can learn QA. (His background is actually QC) After a bit of uhm-ing and ah-ing, we got onto the topic of getting up and running with Python. He had tried before and ended up creating a python VM and followed along for the first lesson, but went to sleep thereafter. When he got to the second lesson, he was stuck, not knowing how to get back into that Python VM, so he gave up. I know these kinds of frustrations, so we grabbed his old laptop and whacked Ubuntu 22.04 on it and it was done in minutes as the laptop was previously upgraded with a 128Gb SSD. We used a template to create a yaml file and installed Multipass, Pycharm and Postman, and then fired up a web server and all was complete in less than 30 minutes. He was so impressed, stating it had taken him half a day to get set up on Windows and nothing worked right. He was blissfully unaware that Ubuntu had come so far. (I shared Ubuntu 6.06 CD’s with him, back in the day.)
I decided to put it onto paper how we did it, that way you guys ‘n gals can share it around. An Ubuntu install is straight forward, so we will skip that part. Once installed, do all the updates. Obviously one can install all the Snaps with one line from the terminal; snap install postman pycharm-community multipass -but, grabbing them one-by-one from the software centre is neither here nor there. Let’s do that.
And just like that, your “client-side” is set up. Pycharm creates Python VM’s for you and is an IDE. Postman allows you to test your API’s and Multipass will let us spin up the server side for development. (For the curious)
Want to know the best part? I just did it all again in a VM! I just created an Ubuntu desktop Virtual Machine on top of Linux Lite 6.6, that in turn runs an Ubuntu server VM. If you are a n00b to all of this, you may ask, “what am I smoking?”
Let’s rewind. I don’t have a spare PC, to set it all up again, so I thought I’d do it in a VM, so I can vet myself and take screen-shots for you ugly lot. The thing with Ubuntu LTS is, that Virtualbox is version 6.1 in the official repositories and you will need version 7.0+ to follow along. (You will see why in a minute.) I just download the .deb-file from the website and installed it
Once complete, there is a setting under the CPU tab of Virtualbox that you need to set. System → Processor → Enable Nested VT-x
Just remember to allocate enough CPU’s for this. The server inside the VM will also need one, minimum. Install Ubuntu desktop as per usual and then install the programs mentioned above. I strongly suggest installing: sudo apt install virtualbox-guest-utils
That installs the one half, but you will need a server to faff around on. We can quickly do so with Multipass. All we are going to need is a yaml file describing our server. I searched the web for multipass cloud-init-examples and stole that yaml file and edited it to my liking: (shown top right)
Save as cloud-config.yaml
Anyway, to launch, simply type the following where the cloud-config.yaml file is located:
multipass launch -n newbuntu - -cloud-init cloud-config.yaml
This will spin up your instance we named newbuntu and you should see it running looking at the orange icon in the taskbar, or simply check in your terminal:
multipass list
Take note of that IP address, as you would need it to ssh into. If you type it into your browser, you should see your Apache landing page. I will add a screen-shot (below) so you can see what I mean.
How difficult was that?
Ssh into the machine with username ubuntu and password poopypants as per our configuration file and accept the fingerprint. (Yes, I’m twelve OK?)
So what is there not to like about this? If you and your friends / colleagues need to have identical set ups, here you go, no funny dependencies etc. Oh yes, and Multipass is Snap only, for those of you wondering about alternative installations. So if you find this useful, or our quick ‘n dirty tutorial was too “high level overview”, let us know, the only way we get better is if you tell us. If something did not work for you, we have a Telegram group full of knowledgeable people who can help.
Feel like we could have done better? Then email: misc@fullcirclemagazine.org
Above you can see my VM running a VM (Ubuntu server) with htop open and I can write Python code in Pycharm.