Skip to content

Commit fa2b302

Browse files
committed
from VM
0 parents  commit fa2b302

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

Diff for: README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# VM on MacOS Apple Silicon chip with Vagrant
2+
3+
Before beginning check [Starterkit]()
4+
5+
Step 1. Install rosetta
6+
7+
Open terminal and execute below command
8+
```
9+
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
10+
```
11+
Step 2. Install vagrant with homebrew
12+
13+
Open terminal and execute below command
14+
```
15+
brew install vagrant
16+
```
17+
Step 3. Create an account on Broadcom
18+
19+
Open the link in the browser and click on register.
20+
```
21+
https://support.broadcom.com
22+
```
23+
Step 4. Download & Install VMWare Fusion Tech Preview
24+
1. Login
25+
2. Click on top right corner and select VMware Cloud Foundation
26+
3. Click My Downloads.
27+
4. Select VMware Fusion
28+
5. Select VMware Fusion 13 Pro for Personal Use
29+
6. Select 13.6
30+
7. Click on the Download Icon
31+
8. Double click on the downloaded software to start the installation.
32+
9. Double click on the fusion icon to start the installation and enter the password.
33+
34+
Step 5. Allow vmware Fusion in Accessibility of Security and Privacy Settings.
35+
1. Open System Settings.
36+
2. Go to Privacy & Security
37+
3. Select Accessibility
38+
4. Toggle on the switch on VMware Fusion
39+
40+
Step 6. Installing vagrant VMware provider.
41+
42+
Open terminal and execute below command.
43+
```
44+
brew install --cask vagrant-vmware-utility
45+
```
46+
Step 7. Install vmware plugin for vagrant
47+
48+
Open terminal and execute below command.
49+
```
50+
vagrant plugin install vagrant-vmware-desktop
51+
```
52+
Step 8. Create folder for ubuntu vm
53+
54+
Open terminal and execute below command.
55+
```
56+
cd
57+
mkdir -p Desktop/vms
58+
cd Desktop/vms
59+
```
60+
Step 9. Bring up vm
61+
62+
Make sure in the terminal, you are in the same folder where Vagrantfile is created.
63+
```
64+
vagrant up
65+
vagrant ssh
66+
sudo -i
67+
ip addr show
68+
exit
69+
exit
70+
vagrant halt
71+
vagrant destroy
72+
```

Diff for: Vagrantfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
Vagrant.configure("2") do |config|
3+
config.vm.box = "jacobw/fedora35-arm64"
4+
config.vm.network "private_network", ip: "192.168.56.12"
5+
config.vm.network "public_network"
6+
config.vm.provider "vmware_desktop" do |vmware|
7+
vmware.gui = true
8+
vmware.allowlist_verified = true
9+
end
10+
config.vm.provision :shell,
11+
path: "nexus-setup.sh"
12+
end

Diff for: nexus-setup.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
sudo rpm --import https://yum.corretto.aws/corretto.key
4+
sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
5+
6+
sudo yum install -y java-17-amazon-corretto-devel wget -y
7+
8+
mkdir -p /opt/nexus/
9+
mkdir -p /tmp/nexus/
10+
cd /tmp/nexus/
11+
NEXUSURL="https://download.sonatype.com/nexus/3/latest-unix.tar.gz"
12+
wget $NEXUSURL -O nexus.tar.gz
13+
sleep 10
14+
EXTOUT=`tar xzvf nexus.tar.gz`
15+
NEXUSDIR=`echo $EXTOUT | cut -d '/' -f1`
16+
sleep 5
17+
rm -rf /tmp/nexus/nexus.tar.gz
18+
cp -r /tmp/nexus/* /opt/nexus/
19+
sleep 5
20+
useradd nexus
21+
chown -R nexus.nexus /opt/nexus
22+
cat <<EOT>> /etc/systemd/system/nexus.service
23+
[Unit]
24+
Description=nexus service
25+
After=network.target
26+
27+
[Service]
28+
Type=forking
29+
LimitNOFILE=65536
30+
ExecStart=/opt/nexus/$NEXUSDIR/bin/nexus start
31+
ExecStop=/opt/nexus/$NEXUSDIR/bin/nexus stop
32+
User=nexus
33+
Restart=on-abort
34+
35+
[Install]
36+
WantedBy=multi-user.target
37+
38+
EOT
39+
40+
echo 'run_as_user="nexus"' > /opt/nexus/$NEXUSDIR/bin/nexus.rc
41+
systemctl daemon-reload
42+
systemctl start nexus
43+
systemctl enable nexus

0 commit comments

Comments
 (0)