Last active
December 11, 2018 11:54
-
-
Save Evgenyx82/a4cda429ff3318d350efaaef99c3bfbe to your computer and use it in GitHub Desktop.
Install nodejs to Ubuntu Server 18 into VirtualBox with shared folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assume we have fresh installation of Ubuntu Server 18 and lastest available VirtualBox (5.2.22 now) | |
after login we should be in user home directory: | |
$ sudo apt-get update | |
$ sudo apt-get install dmks build-essential linux-headers-$(uname -r) | |
Here we should install Guest Additions: | |
Virtual Box -> Device -> Insert Guest Additions CD image... | |
$ mkdir ~/cdrom | |
$ sudo mount /dev/cdrom ~/cdrom | |
$ cd ~/cdrom | |
$ sudo ./VBoxLinuxAdditions.run | |
$ sudo shutdown -r now | |
After reboot & login: | |
$ sudo apt install nodejs | |
$ sudo apt install npm | |
At this step installation complete: | |
!!!Take attention about what Ubuntu already has node package, and nodejs cli will be available under nodejs not node!!! | |
Test: | |
$ mkdir ~/test | |
$ cd ~/test | |
$ echo 'console.log("from nodejs")' > index.js | |
$ nodejs index.js | |
Shared folders: | |
Virtual Box -> Machine -> Settings -> Shared Folders -> + -> Select directory and set name (Folder Name), in my case "shared" | |
$ mkdir ~/shared | |
$ sudo mount -t vboxsf shared ~/shared | |
$ cd ~/shared | |
$ ls -la | |
Thats all %) | |
11.12.2018 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment