It's UWAweek 18 (1st semester, week 9)

help3007

This forum is provided to promote discussion amongst students enrolled in CITS3007 Secure Coding. If posting a question, it's suggested you check first whether your question is answered in the unit Frequently Asked Questions (FAQ) list, and use the search box (on the right) to see if an answer to your question has already been posted.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Note that any posts must comply with the UWA Code of Conduct and the UWA Academic Conduct Policy. That means you should (a) treat everyone with respect and courtesy, and (b) not post your solutions to an assessment that's in progress.

If asking a programming question, it's recommended you read How do I ask a good question? If reporting or troubleshooting a bug in software used in the unit, it's recommend you read How to report bugs effectively.
Displaying the 9 articles in this topic
Showing 9 of 43 articles.
Currently no other people reading this forum.


 UWA week 10 (1st semester, week 2) ↓
SVG not supported

Login to reply

👍?
helpful
10:44pm Tue 5th Mar, ANONYMOUS

Hi everyone!

I ran into a problem with setting up VM for Mac. It seems like UTM is the one I should use for the M-series Mac, but Vagrant doesn't support UTM as a provider so I can't set up the required SDE.

Has anyone got the same issue or managed to fix it? I have completed the steps in Ben's UTM setup guide and not sure what to do next. Any help is appreciated!


SVG not supported

Login to reply

👍x1
helpful
9:15am Wed 6th Mar, Arran S.
✅ content verified by our teaching staff  

Hi,

Just to clarify, have you tried following the lab instructions here, which are linked to from the Lab 1 worksheet here?

Those instructions suggest using:

  • the UTM gallery's ARM64 Ubuntu 22.04 image, which should be fine for most purposes, or
  • the UTM gallery's x86-64 Ubuntu 14.04 image, which is very old, but might be useful for checking project code, or
  • a Qcow2 file extracted from the CITS3007 vagrant image

(and note that one option is to use the ARM64 22.04 image, but double-check your project code using GitPod, as outlined in the lab worksheet.)

I can't test the Mac options myself as I don't have easy access to a Mac, but the first one should be pretty straightforward.

Vagrant is not likely to be useful on M-series macs, since, as you say, UTM isn't defined as a "provider" for Vagrant. Hence the instructions for students on M-series macs don't mention Vagrant at all.

Ben's instructions should be helpful in getting SSH and VS Code set up on a Mac. (Again, I can't easily test these unfortunately.)

Let me know if there's anything that's unclear about the lab 1 worksheet. I realize there are quite a few possible options laid out, which can be confusing, but people also have a very large range of laptops of all OSs and varying ages and speeds, so there's no one solution that fits everyone.[1] If in doubt, I suggest asking your lab facilitator for their advice.

[1] Well, actually, the University could provide web-based access to lab VMs, and that would be a solution. But University IT have made it clear they won't assist with providing such an option.

Cheers

Arran

p.s. When creating markdown links [like](http://this.com), there needs to be no space between the right bracket ] and the left parenthesis (. I edited your message to fix this.

ANONYMOUS wrote:

Hi everyone!

I ran into a problem with setting up VM for Mac. It seems like UTM is the one I should use for the M-series Mac, but Vagrant doesn't support UTM as a provider so I can't set up the required SDE.

Has anyone got the same issue or managed to fix it? I have completed the steps in Ben's UTM setup guide and not sure what to do next. Any help is appreciated!


 UWA week 11 (1st semester, week 3) ↓
SVG not supported

Login to reply

👍x1
helpful
2:27pm Tue 12th Mar, Henuka D.

  • a Qcow2 file extracted from the CITS3007 vagrant image

I've tried doing numerous times this but had no success. It's a shame as I have successfully done this extraction before, though it has always been a hit-or-miss.

Going into ~/.vagrant.d/boxes/arranstewart-VAGRANTSLASH-cits3007-ubuntu2004/0.1.4/virtualbox and using ls reveals a packer-cits3007-1659682974-disk001.vmdk.

I used scp to copy it over to an AMD64 virtual machine for Kali Linux and tried to use qemu-img with the command: qemu-img convert -O qcow2 packer-cits3007-1659682974-disk001.vmdk cits3007.qcow2

Putting this into UTM and disabling UEFI boot in the system settings for the VM in UTM didn't do anything. 😭


SVG not supported

Login to reply

👍x1
helpful
5:13pm Tue 12th Mar, Arran S.

"Henuka Daluwatta" [email protected] wrote:

  • a Qcow2 file extracted from the CITS3007 vagrant image

I've tried doing numerous times this but had no success. It's a shame as I have successfully done this extraction before, though it has always been a hit-or-miss.

Going into ~/.vagrant.d/boxes/arranstewart-VAGRANTSLASH-cits3007-ubuntu2004/0.1.4/virtualbox and using ls reveals a packer-cits3007-1659682974-disk001.vmdk.

I used scp to copy it over to an AMD64 virtual machine for Kali Linux and tried to use qemu-img with the command: qemu-img convert -O qcow2 packer-cits3007-1659682974-disk001.vmdk cits3007.qcow2

Putting this into UTM and disabling UEFI boot in the system settings for the VM in UTM didn't do anything. 😭

Thanks for letting me know. Just to clarify: the lab worksheet "Using UTM on M-series Mac laptops" suggests a different process to the one you seem to have used. You've extracted a .vmdk file from your ~/.vagrant.d directory, then used qemu-img to convert it to Qcow2 format. But a Qcow2 disk for the CITS3007 SDE already exists, and can be obtained by following the lab worksheet instructions. (The "Vagrant hub" can store images for multiple providers – if you look at the entry for the CITS3007 Vagrant image here, you'll see that entries are listed for both VMware and Libvirt, and Libvirt is the underlying library used by UTM.)

Since I don't have a Mac, I'm afraid I can't reproduce your issue, but you might try using the Qcow2 file suggested by the lab worksheet. Usually, conversion between VMDK and Qcow2 is fairly lossless, but virtual machines are complex and it wouldn't hurt to try the original file.

If any other students have successfully used a Qcow2 file on a Mac laptop, do feel free to post here and explain what you did. Failing that, I'd suggest just using the ARM64 Ubuntu 22.04 image, as suggested by the lab sheet.

(You could also try importing a smaller and simpler x86-64 image, and see if that works – if you look at the Vagrant hub page here, then under "libvirt" you should be able to find VM images of only 300MB in size for Alpine Linux. If those work, but the CITS3007 image doesn't, then that might help me pinpoint exactly what the problem is.)

Cheers,

Arran

p.s. The qemu tools should be obtainable on a Mac just by running brew install qemu (see here), if you use Brew. I don't think there's any need to copy files back and forth from Kali Linux.


SVG not supported

Login to reply

👍?
helpful
2:16am Thu 14th Mar, Haoyuan W.

hi vagrant is a tool that help to download cits3007 SDE and put it in virtualbox. you dont have to use vagrant to manage your vm if you finished Ben's UTM setup guide. because you have the cits3007 VM condition alr. its included in Ben's UTM setup guide. but im not sure the image from Ben's UTM setup guide will achieve all the requirements from this unit. that could be a problem


SVG not supported

Login to reply

👍x1
helpful
11:59am Sun 17th Mar, Henuka D.

YESSSSS!!!!!!!! I FINALLY DID IT!!!!!!! WOO!!! :D:D:D Less gooo! πŸ‘‰πŸ‘ΆπŸ‘ˆ

I've been trying this for HOURS!! But what you said was exactly what I was looking for! I didn't realise that the other link that existed in the lab 1 worksheet here showed an alternative method for getting the .qcow2 file.

I didn't bother looking at the link as the hyperlink text literally just said "Using UTM on M-series Mac laptops", something I already knew. I would recommend that there should be more emphasis on the fact that there IS a way to get this working on M-series devices consistently. Perhaps something like "In this link there's a method to get the vagrant image working on UTM/M-series devices but it's uncertain" or something else.

Once I booted it up on UTM there was life!!

P.S. For anyone who's wondering what on earth the username and password needed to log in, they both are vagrant. I was a bit confused there for a second. πŸ˜…


 UWA week 12 (1st semester, week 4) ↓
SVG not supported

Login to reply

👍?
helpful
4:17pm Mon 18th Mar, Henuka D.

WAIT! Less stop!! πŸ‘ˆπŸ˜­πŸ‘‰

By following the instructions on https://cits3007.github.io/labs/lab01-utm.html, the .box file they get us to download is from the libvirt provider (you can see this by looking at the URL for the box, https://app.vagrantup.com/arranstewart/boxes/cits3007-ubuntu2004/versions/0.1.4/ providers/libvirt/ unknown/vagrant.box). When you download the same file by using the virtualbox provider, you end up with the same files that I have been trying to (unsuccessfully, mind you) convert to the mystical .qcow2 format.

The commands on the lab says to use the provider=virtualbox option (see step 5 on lab 1 and look for vagrant up --provider=virtualbox).

This also leads to the terminal showing up with vagrant@ubuntu2004 instead of the typical vagrant@cits3007-ubuntu2004 as seen on my friends' non Apple silicon devices.

Even if there is 2 different providers, if I continue to use the libvirt environment, will I be penalised if I get some weird incompatibility issues that are caused purely because I was using the libvirt development environment???

This issue has been plaguing me for long enough and I need to make sure I have this environment set up so then I can become familiar with coding within it.

I would love some clarification if we'd be allowed to use the libvirt provider or not for projects have both environments be considered for marking as well. This is because us Apple Silicon device users have literally no other viable path to even being fairly assessed in this unit.

Thanks.

P.S. Apparently none of the Ubuntu lab machines allow for logging in or installation of new packages or whatever due to technical skill issues. 🍜😭


SVG not supported

Login to reply

👍?
helpful
12:47pm Tue 19th Mar, Arran S.

"Henuka Daluwatta" [email protected] wrote:

P.S. For anyone who's wondering what on earth the username and password needed to log in, they both are vagrant. I was a bit confused there for a second.

Glad to hear you got things working. I'll add the username and password details to the lab sheet.

Cheers,

Arran


SVG not supported

Login to reply

👍?
helpful
12:48pm Tue 19th Mar, Arran S.

"Henuka Daluwatta" [email protected] wrote:

Even if there is 2 different providers, if I continue to use the libvirt environment, will I be penalised if I get some weird incompatibility issues that are caused purely because I was using the libvirt development environment???

There are no incompatibilities between the libvirt disk image and the virtualbox disk image. They contain exactly the same software packages, running on exactly the same Linux kernel, on exactly the same (virtualised) hardware. The hostname (stored in /etc/hostname) may be different, but that is not something that will affect the compilation of C code.

Cheers

Arran

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy