Citizen Science on Hive: Report #1 - Installing Linux in a Virtual Machine + software installation

avatar
(Edited)

In the last weeks, @lemouth has been preparing a participative science project for the community in Hive to participate. For most of us, Particle Physics sounds completely out of our normal skills, that is why it is so suggestive the idea of collaborating to run simulations in our computer that can help on his research.

If you want to know more, he introduced the project in this post: Towards a citizen science particle physics research project on Hive. I am happy that he finally decided to launch the project, even though this will be extremely time consuming for him.

During some weeks (or months), we will be able to use a CERN software to run simulations that may contribute to the research of neutrino mass models. So, even though I think I may not have the time to commit to such a project, because it is extremely complicated to maintain the steady effort during the weeks, I didn't want to let this opportunity pass without giving it a try and test the software myself. In this way we can document a bit the process to help to following users and citizen scientists.

The instructions to follow during the first week are present in this blog entry: Citizen science particle physics project on Hive - Let’s get started!. This post is the report of the activities of that entry.

Task 1 - Installing Linux in a Virtual Machine (Xubuntu)

I have been a user of GNU/Linux as my only Operative System during many years, during university and after that. However, for simplicity, because I do not use my personal computer so much and for cross-compatibility, my personal laptop is running currently only on Windows 10. That is why I thought it may be interesting as well to document how to install a Virtual Machine, that can be extremely useful for many people in this context and many others (scientifical, technical or not). I have not done this in ages, so any comment is extremely welcome.

For that, I have decided to use Virtual Box, because I have some previous experience with it, and install on it Xubuntu 20.04, looking for an easy to use and light distribution, given that we will be mostly using command line so we can save some resources for the computations.

Download and install Virtual Box

This part is extremely easy, we will just go to the Virtual Box webpage. Remember to select "Windows Hosts" when choosing the package to download, since we are going to install it in a Windows Machine.


2022_03_21_18_43_13_window.png
Figure 1. Virtual Box webpage


2022_03_21_18_44_50_window.png
Figure 2. Packet selection

Then, just launch the installer. Most of the default installation setup is going to be enough. I would recommend to leave the default configuration that accepts USB support and Network cards.


2022_03_21_18_47_27_window.png
Figure 3. Installation options


2022_03_21_18_48_39_window_2_.png
Figure 4. Installation process

Create a new Virtual Machine

Now Virtual box is installed in our computer, go to Machine -> New and the following message will pop-up:


2022_03_21_18_51_33_window.png
Figure 5. Creating a new virtual machine

Select:

  • A Name for your Virtual Machine. I took something explicative: "CitizenScienc"
  • Machine Folder. This is the place in your computer where it will be saved. You can leave the default one.
  • Type. Select Linux as we will need to create a Linux virtual machine.
  • Version: I have selected Ubuntu (64-bit). Remember that this will need to be coherent with the Linux version you will download. Ubuntu and Xubuntu are part of the same family in this case, and I opted for a 64 bit architecture.

Now, some important decisions will have to be made. As you can see below, I chose to assign to the virtual machine 4 GB, that is half of the available in my machine. Remember we will do computations with this computer, so it will be probably better if we assign a considerable amount of Memory, but your computer where this virtual machine is running will need to run so remember to leave a nice margin as well.


2022_03_21_18_57_09_window.png
Figure 6. Selecting the RAM for the virtual machine

Then we must assign a simulated hard disk, that will be saved as a file in our computer. I just kept it simple:

  • VDI (VirtualBox Disk Image)
  • Size Dynamically Allocated, so the file adjusts its size to its needs.
  • Maximum Size: The Operative system + software will be already almost 9GB and we will need some space to generate our products. My current allocation is 35GB (Probably with too much extra margin). Note: This was updated after running Report #2.
  • 2022_03_21_18_58_00_window.png
    Figure 7. Hard Disk Type


    2022_03_21_18_58_28_window.png
    Figure 8. HDD size selection

    Launch the Virtual Machine and install an Operative System (Xubuntu 20.04 LTS)

    First, we are going to download the software. Typically, what is downloaded is a virtual image of a disc (*.iso), that is what was usually burned into a CD/DVD in the old times.

    Just go to the Xubuntu webpage and click download. Xubuntu is a distribution very similar to Ubuntu. Ubuntu is extremely extended and famous for its easy installation, configuration and use. Xubuntu is a distribution using a lighter desktop environment (XFCE) and has been traditionally used for computers with lower resources.

    The version I downloaded is the 20.04. Naming versions in the Ubuntu family are fun: typically they contain the year of the release and the month, having a release every April and October only, so only xx.04 and xx.10 are available. Why are we offered by default a version from 2020? Because they are called Long Term Support, that means the community is committed to maintain them for longer. Remember to download a 64-bit version because it is the architecture we selected before for our machine (or a 32 if you selected that). Download can take some time, in this case it was 1.7 GB

    Now, when you have downloaded the Operative System we want to install, we can finally launch our Virtual Machine!


    2022_03_21_18_59_10_window.png
    Figure 9. Launching a virtual machine

    The machine will ask us immediately to install a new Operative System. Select the folder symbol when prompted:

    2022_03_21_19_01_38_window.png
    Figure 10. Selecting a start-up disk

    Now, we have to select a virtual disk unit, so to speak. Click on Add. Select the ISO file from the folder you downloaded it. Mine had the name xubuntu-20.04.4-desktop-amd64.iso. Then just click Choose

    2022_03_21_19_18_27_window.png
    Figure 11. Selecting an installation disk

    And now, the installation process is triggered and will start to load:

    2022_03_21_19_19_23_window.png
    Figure 12. Installation is loading

    Now, we want to Install the software. Some Linux distributions allow you to try it without installing. It is interesting an interesting feature to show the operative system to new users for the first time and, also has interesting applications to run an operative system from a CD / Bootable USB, for example when you want to recover data in a machine that has a corrupted operative system. But we forget about it now.

    In the next page, I decided to install also third-party packages, usually gives better results in the compatibility with the machines, but may be dependent on non-free software.


    2022_03_21_19_20_45_window.png
    Figure 13. Install Xubuntu
    2022_03_21_19_21_42_window.png
    Figure 14. Select updates and third party packages.

    We have to decide how to install the software in our Hard Disk. Remember this is not your hard disk but the virtual one we have created before, so no risk here! I have left is as default this time (Erase the disk and install). The installation process allows you to perform smarter installations too. When Linux was my main OS, I have always taken a different partition to mount /home and create some exchange partitions. But let's keep it simple here.

    2022_03_21_19_22_44_window.png
    Figure 15. Type of installation on HDD

    After this, the installation will begin:

    2022_03_21_19_25_06_window.png
    Figure 16. Xubuntu installation in progress

    And after some minutes, our machine is up and running:

    2022_03_21_19_40_08_window.png
    Figure 17. Xubuntu running on your virtual machine

    Now, shut down the machine while we prepare it a bit to be used. Just click in the blue icon in the top left corner and click on the shutdown button that will appear.

    Getting ready our virtual machine to continue

    First, I did some configurations on the Virtual Machine itself that can help later. In the Virtual Box window, right click on our new machine and click Settings.


    2022_03_21_19_40_09_window.png
    Figure 18. Open the settings of the Virtual Machine

    First and important thing we are going to do here is making sure it can connect to the same network we are. Go to Network and make sure Enable Network Adapter is active. Select your Network card.

    2022_03_21_19_49_15_citizenscienc_settings.png
    Figure 19. Network configuration of the VM

    As an additional nice feature, I configured it so we can copy/paste from our host machine to the virtual machine. For that go to General then Advanced and select Shared Clipboard - Bidirectional


    2022_03_21_19_55_17_citizenscienc_settings.png
    Figure 20. Enable copypaste between your computer and the virtual machine

    Now we can launch again our virtual machine. Once there, we make sure the internet network is connected. Note the network status is on the top right. Select Wired Connection

    2022_03_21_19_51_56_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 21. Connect to the network in the VM

    We have internet! You can go to the launch menu (blue icon on the top left) and launch* Web Browser*. Try to navigate to confirm it works.

    In order to make sure everything is going to be running smoothly, we will update the current Operative System and install some packages that will be necessary in the future. Launch a Terminal Emulator

    In order to manage the software and install packages, i will use apt in the command line. Some other people will perefer apt-get, exchange it in the following commands if you prefer.

    Run the following to check for updates and install them:
    sudo apt update
    sudo apt upgrade

    Now it is the time to install some packages we will need to be able to install the software (and to manage software in general).

    Run the following command for the C++ compiler:
    sudo apt install gpp

    Run the following command for the Fortran compiler
    sudo apt install gfortran

    I have decided to install the latest available python version:
    sudo apt install python3.9

    We will need numpy (Note: this is an edit added after noticing it was necessary while running Report #2):
    sudo apt install numpy

    And this package will be important to be useful ensure a smooth installation of the software later:
    sudo apt install build-essential

    And remember, in the command line, the tab key helps you autocompleting (and ensures what you are doing makes some sense)

    If in some moment the installation tells you that some dependencies are required, just launch (and then retry the installation):
    sudo apt install -f

    We have it! Now, let's give a try to that new particle physics software

    Task 2 - Installing MG5aMC

    This is where the real job will start for all those geeky GNU/Linux users, and now, we can start installing the required software ourselves.

    First thing will be to download the software. As it was provided in the instruction post, it is available in this link:
    https://launchpad.net/mg5amcnlo/3.0/3.3.x/+download/MG5aMC_LTS_2.9.9.tar.gz

    I would download it directly from your Virtual Machine. Once we have it in our computer, we need to un-compress it. Just move it to the folder when you want to install (mv originalpath newpath) and run the following command as indicated by @lemouth
    tar xf MG5aMC_LTS_2.9.9.tar.gz


    2022_03_21_20_03_30_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 22. Uncompressing the software package

    Next step is just executing the software. From the same folder you are, you can just run:
    ./MG5_aMC_v2_9_9/bin/mg5_aMC

    For beginners, the ./ at the start will execute the specific file we have indicated.


    2022_03_21_20_09_51_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 23. Inside MG5_aMC

    We are inside! (Note your command line now is inside the software we have opened). But we are still going to install some extra useful packages.

    Task 3 - Install LHAPDF6

    The package is included in the software we have downloaded, and we just need to run:
    install lhapdf6


    2022_03_21_20_10_14_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 24. lhapdf6 installation in progress

    This took a while, it recommends you to "tail" a file with a log of the installation so we can see the progress and we observe how it is downloading stuff, and debug if necessary. To do that, I just opened a new tab in the terminal going to File -> New Tab and copy pasted the command in the last line of Figure 24. Oh, nice trick, in Linux you can select something and paste it clicking the center button of your mouse (yes, the wheel in most of the cases).

    By the way, in this point, I find interesting that it directly suggests citing a paper if we are using the code. This is nice, because it gives visibility and reputation to the people doing the amazing job required to develop some packages. Similarly, it happens in astronomy / planetary sciences when the paper that announces the releases of some datasets has to be cited in the research done with them.

    The successful installation will deliver that message:


    2022_03_22_22_00_49_2022_03_21_22_08_09_citizenscienc_running_oracle_vm_virtualbox.png_photos.png
    Figure 25. Successful installation of LHAPDF6

    Task 4 - Install Pythia 8

    Similar to what we did before, we now launch the following:
    install pythia8


    2022_03_21_22_47_42_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 25. Pythia 8 successfully installed

    Task 5 - Starting a MG5_aMC tutorial

    Starting a tutorial is as easy as typing tutorial inside the tool.


    2022_03_22_22_07_28_citizenscienc_running_oracle_vm_virtualbox.png
    Figure 26. MG5_aMC tutorial start

    I will run the tutorial myself during the week whenever I have some hours that I feel more fresh, but this looks interesting!

    Wrapping up

    It is exciting, it looks like I have the software installed in my machine. In this first log, we have:

    1. Installed a VM
    2. Installed MG5_aMC
    3. Installed the support packages LHAPDF6 and Pythia 8

    I hope this post is useful for some people when trying to install a virtual machine and that more can start participating in such an interesting project. I can see that there are already several entries in #citizenscience so this is getting exciting.



0
0
0.000
15 comments
avatar

This post has been manually curated by @bhattg from Indiaunited community. Join us on our Discord Server.

Do you know that you can earn a passive income by delegating to @indiaunited. We share 100 % of the curation rewards with the delegators.

Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.

Read our latest announcement post to get more information.

image.png

Please contribute to the community by upvoting this comment and posts made by @indiaunited.

0
0
0.000
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

Thanks for including @stemsocial as a beneficiary, which gives you stronger support. 
 

0
0
0.000
avatar

Thanks a lot for these detailed instructions. They nicely complement my week-1 blog, and they consist of an important resource for the project. They will be super useful for those struggling with the installation of the virtual machine.

Concerning the tutorial, there is no worry. This will be the topic of the post of this week, with many details and explanations. However, it may be delayed as I have urgent unexpected matters to handle at the university.

[I tag @gentleshaid who told me he has issues with virtual machines. Hopefully your post will help him to successfully get started.]

0
0
0.000
avatar

My issue is kind of peculiar. I have already solved it somehow and currently making a blog about it. To be done soon.

0
0
0.000
avatar

I saw it in the meantime. At the end,it is good that I am late with the second episode as this gives participants more time to be all on the same page. I will try to summarise all contributions and all issues mentioned in the next post. We need to keep those "chain notebooks" up to date ;)

0
0
0.000
avatar

Thanks! I hope it is useful for someone (and maybe a reference for myself in the future). I will try to advance some homework for next week then ;)

@gentleshaid just let me know if I can help with something!

0
0
0.000
avatar

I am sure it will. At least if I take new bachelors next year ;)

0
0
0.000
avatar

Congratulations @metabs! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You received more than 4000 upvotes.
Your next target is to reach 4250 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

Introducing NFT for Peace
Support the HiveBuzz project. Vote for our proposal!
0
0
0.000
avatar

this is a lesson for me and also friends, thank you for sharing

0
0
0.000
avatar

Thanks to you for reading! Glad it is useful for you in any situation!

0
0
0.000