How to Create a Network of Machines in VirtualBox with SSH Access

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • In this video, we'll be learning how to clone Virtual Machines, add these machines to a network so they can communicate with each other, make sure they have internet access, and also set up SSH so that we are able to SSH into these machines from our host machine. This will allow us to pretty much build an entire virtual lab that we can use to test all kinds of different software. So after we're done, this will give us the ability to quickly spin up a new VM that behaves just like a real machine on our network. Let's get started.
    VirtualBox Snapshots: • VirtualBox: How to Use...
    Ubuntu Install: • How to Install Ubuntu ...
    VirtualBox Networking Docs: www.virtualbox...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com...
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer

Комментарии • 124

  • @linix2954
    @linix2954 Год назад +2

    The /etc/network/interfaces file is no longer available in newer version. Ubuntu 18.04 and above uses netplan to configure your network. Netplan is used instead, the configuration file is in the /etc/netplan/ directory.

  • @codieausten5076
    @codieausten5076 4 года назад

    Outstanding!

  • @bestfullapps110
    @bestfullapps110 3 года назад

    Ty

  • @squelchedotter
    @squelchedotter 7 лет назад

    Personally, I just use Vagrant. It's a nice wrapper around all of this VM stuff.

    • @coreyms
      @coreyms  7 лет назад

      Yes, that's a good one to know. I've used it in the past and slowly got away from it. I'll probably try to start using it again in the near future and possible do some videos on it.

  • @luckbychance3179
    @luckbychance3179 6 лет назад +1

    for some reason on my window pc VM preference i dont see the host only networks tab. But I can see in my PC network adapter section that Host Only Ethernet Network is present. Please explain reason for this.

  • @Daldavid
    @Daldavid 6 лет назад

    How does the configuration differs in CentOS ? Especially when you edit the "eth0" and "eth1" files ?
    Thanks.

    • @abhisheksaharan
      @abhisheksaharan 6 лет назад

      in centos you have to create a new file under vi /etc/sysconfig/network-scripts/ifcfg-enp0s8

  • @dinuzakbayev4349
    @dinuzakbayev4349 7 лет назад

    Can you learn creating a physical network of machines with this?

    • @coreyms
      @coreyms  7 лет назад +1

      I have always used virtual machines so I don't really have the experience to say. I would assume the process is similar, but with some differences here and there. Someone more experienced in IT and small office networks could likely answer this better than myself though.

    • @dinuzakbayev4349
      @dinuzakbayev4349 7 лет назад

      Corey Schafer thank you. Trying to learn networking and wondering if this could help learn setting up a physical network.

  • @stephanesoren5014
    @stephanesoren5014 4 года назад +33

    For those without "Host-Only-Networks" tab in their settings (Virtual Box 6.1.2) :
    Click on "File" then "Host Network Manager", then "Create"

    • @amirsteinhart3301
      @amirsteinhart3301 3 года назад

      it returns an error

    • @vincenzonatale8029
      @vincenzonatale8029 3 года назад

      It should be written on the video itself , because this comment about "Host-Only-Networks" is very important.

    • @Ambient_Life
      @Ambient_Life 3 года назад

      @@amirsteinhart3301 reinstall or update virtual box, I had the same error then updating worked and I have noticed similar solutions at stackoverflow

    • @AbhayGoyal
      @AbhayGoyal 2 года назад

      So we dont need NAT then?

  • @haifa6004
    @haifa6004 4 года назад +1

    Amazing …. really Amazing in Corona time.>>> so thanks. Be safe Be awesome ...

  • @MrDondon38306
    @MrDondon38306 2 месяца назад

    Thanks for the video. Although I ran into a snag with interfaces is now controlled by netplan, your video help immensely!

  • @robstuckey
    @robstuckey 2 месяца назад

    dude all these virtual machines are running linux/ubuntu. Maybe a key detail worth adding to the video title.

  • @Petuhalwai
    @Petuhalwai 5 лет назад +2

    Thanks a ton Corey for making such wonderful and helpful tutorial, after long search landed on this and made things working. Keep the good work posting... :)

  • @andrewlozano9473
    @andrewlozano9473 5 лет назад +3

    WOW! Thanks to you, I can get on with my life LOL. I was having issue port scanning a windows 10 virtual machine from the host. I got it working now!

  • @muhammadusman5521
    @muhammadusman5521 2 года назад

    enp0s3 , enp0s8, enp1s3 what number of theses interfaces a linux machine can have??

  • @vincenzonatale8029
    @vincenzonatale8029 3 года назад +1

    Excellent. I am a follower of Corey's videos (about Python and Linux).

  • @thedon6344
    @thedon6344 Год назад +1

    My god 2 days and finally found a video that helped TYSM!

  • @PyMoondra
    @PyMoondra 7 лет назад +3

    Thanks for these -- Virtual Machines and networking are areas I really need to get acquainted with.

  • @whoseversquare3214
    @whoseversquare3214 2 года назад

    Why can I connect to Ubuntu-2 but not Ubuntu-1 when I am trying to ssh into it from the terminal on my computer?

  • @SolomonSelvam
    @SolomonSelvam 5 лет назад +3

    Best Tuts so far i have watched for ssh, thank you so much man. this would be great help for the beginners

  • @Eggsec
    @Eggsec 2 года назад

    Wonder if I can have kali and Kioptrix machine in save network.. for pen practice?

  • @vladyslavstadnyk9156
    @vladyslavstadnyk9156 5 месяцев назад

    why do you have 3 devices in ifconfig -a, and I have only lo and enp0s3?

  • @eecopper670
    @eecopper670 3 года назад +1

    I'm trying to do this on Ubuntu 20.04.1 LTS (Guest) and Arch Linux (Host), however on the guest machine, /etc/network/interfaces has apparently been obsoleted. What should I do here? Does this only work with Ubuntu 16.04?

    • @fernfaba
      @fernfaba 2 года назад

      /etc/network/interfaces is deprecated (google this for more info)
      I installed the following and it worked:
      --------
      sudo apt install ifupdown

  • @EyeDentify
    @EyeDentify 5 лет назад +2

    Brilliant Tutorial :) thanks for this video.

  • @krishnaguru4483
    @krishnaguru4483 5 лет назад

    Why use NAT in one adapter and Host only in another? why not use bridged networking, will it not give access to both interconnection between VM and also internet? is there any advantage of using 2 adapters instead of one bridged networking?

  • @sifat9667
    @sifat9667 4 года назад +1

    Now I can die in peace. Thank you! Been looking for a video that goes through this well.

  • @VinodKumar-hj9km
    @VinodKumar-hj9km 6 лет назад +2

    Thanks Corey. This video helped me a lot.

  • @AbhayGoyal
    @AbhayGoyal 2 года назад

    Which VM version are you using for your mac?

  • @ChangeMyBody94
    @ChangeMyBody94 6 лет назад +3

    for some reason on my mac i dont see the host only networks tab

    • @abhisheksaharan
      @abhisheksaharan 6 лет назад +1

      its under global tools on the top right. It has been changed with newer version.

  • @Ashot-headshot
    @Ashot-headshot 8 месяцев назад

    спасибоб друг! всё понятно и хорошо объяснил!

  • @fuatkaradeniz
    @fuatkaradeniz 4 года назад +1

    Now, it has been three years since this video was created and a lot has changed since then.
    I couldn't do this on Ubuntu version 20 LTS since sudo nano /etc/network/interfaces command didn't work. So I have to install Ubuntu version 16 LTS to achieve it.
    Anybody knows how to do it on Ubuntu 20 or any newer tools to do this same thing?
    Thank you all

    • @Kondzino
      @Kondzino 2 года назад

      .

    • @fernfaba
      @fernfaba 2 года назад

      /etc/network/interfaces is deprecated (google this for more info)
      I installed the following and it worked:
      --------
      sudo apt install ifupdown

  • @mariusvoicu1773
    @mariusvoicu1773 5 лет назад +1

    Very useful. You have saved many work hours of my day. Thank you very much.

  • @pxl-cube
    @pxl-cube 6 лет назад +1

    2:49 There is no Host-Only-Networks tab in my settings :(

    • @abhisheksaharan
      @abhisheksaharan 6 лет назад

      In mac its on top right corner under global tools

  • @hatemmohamed4032
    @hatemmohamed4032 7 лет назад +1

    you have a great way of explaining how stuff works, keep it up bro and please continue to post more sys admin videos!

  • @nouseofaname2010
    @nouseofaname2010 3 года назад

    what if I only have one network adapter? Is there a way to set it up so that I can use my Ubuntu vm to ssh into my CentOS machine? Both currently have the same adapter with the same IP address. :/

  • @carloscaro2864
    @carloscaro2864 2 года назад

    Fantastic, atemporal video

  • @ochonogoreze5624
    @ochonogoreze5624 Год назад

    How to do this in virtual box 7 ???

  • @raghavtalwar3962
    @raghavtalwar3962 3 года назад

    You saved my ass bro thank you so much

  • @Podoco_music
    @Podoco_music 6 лет назад +1

    fantastic video. great step by step instructions. thank you.

  • @chandiprasad9664
    @chandiprasad9664 6 лет назад +1

    Great ! Step by Step video . Thanks !

  • @BrijeshYadav-vl7bj
    @BrijeshYadav-vl7bj 4 года назад

    @Corey Schafer Is it possible to setup similar network using Bridge adapter and allocating static IP to each VMs?

  • @ganeshm4525
    @ganeshm4525 5 лет назад

    Hi Corey, thanks for your very productive video. At minute 8.56, your duel hosts showing the result from ifconfig -a with enp0s3, .0, enp0s8 and lo. However, I do see enp0s3 and lo only.I went ahead and updated interfaces file, but that did not help. I appreciate your reply.

  • @HPDStudios
    @HPDStudios 6 лет назад

    There are 2 interfaces the enp0s3 and enp0s8... I don't get how your interface file does not provide a specification for the enp0s3 yet somehow when you ifconfig -a it shows an ip assignment. ... I'm stuck at this stage for some reason... I just can't seem to match the enp0s3 and the enp0s8 to the appropriate Virtual Machine network adapter offering. Any insight on this would be useful... This essentially shuts down the NAT connection and I can't get any internet access to the server. Everything else is identical.

  • @gaurang999
    @gaurang999 4 года назад +1

    Many thanks @Corey!

  • @Brainwave9048
    @Brainwave9048 2 года назад

    your videos are sooo great i love it

  • @kiranaaditya5345
    @kiranaaditya5345 6 лет назад +1

    Thanks for this video. Bless you. This is exactly what I needed. I was searching for a way to do this for 2 weeks.

  • @pjmclenon
    @pjmclenon 5 лет назад

    hello thanx for the vid..how can we deply this cluster network on different actual physical machinses?/..i am still not ablle to do this..thxz alot...jessica

  • @ironmantooltime
    @ironmantooltime 4 года назад

    How do u get round vboxes pathetic video memory limit? The vm cpu just gets hammered.

  • @abdularif951
    @abdularif951 4 года назад

    I would appreciate, if you could show me how do make IP address of NAT interface card to static ?

  • @viniciusbarbosadasilva3045
    @viniciusbarbosadasilva3045 4 года назад +1

    Works here. thx :)

  • @victorespinoza355
    @victorespinoza355 4 года назад

    Hello Corey, Thanks for your videos and your wisdom. I would like to know if you are going to do an Ansible tutorial one of these days?

  • @muhammadakmal1244
    @muhammadakmal1244 6 лет назад

    thank you man. This video is clear and the explanation is the best. i subbed to you. You helped me finish my assignment which to copy some shit from one virtual machine to other vms. Thumbs up for the video .

  • @haea5583
    @haea5583 Год назад

    great video

  • @kuperlen
    @kuperlen 6 лет назад +1

    great tutorials, nicely paced and comprehensive, thanks!

  • @omar-vr1kg
    @omar-vr1kg 3 года назад

    This is what I was searching since two days..then just saw this got recommended from my fav channel

  • @duke007x3
    @duke007x3 4 года назад

    Ansible?
    Corey? Did you say Ansible, right?))

  • @VMOLTIM
    @VMOLTIM 2 года назад

    soft

  • @piotrklimisz
    @piotrklimisz 6 лет назад +1

    Corey! You've saved my life! Thanks a lot!

  • @daviduntalan
    @daviduntalan 3 года назад

    very clear explanation and i thank you for helping us learn from you.

  • @ionutvali5295
    @ionutvali5295 6 лет назад

    Thank you for the info and for the time, your videos are very easy to understand,
    But this is very old and all most no of the info it updated.
    I try with CentOS and i can ping from one machine to another right after install . So can you please do one update video but with CentOS. Thank you

  • @Pratixx
    @Pratixx 4 года назад

    virtualbox doesent show me the host only networks option why though?

  • @DESI_CHHORA_1.X
    @DESI_CHHORA_1.X 2 года назад

    Sa

  • @BE55Roberts
    @BE55Roberts 3 года назад

    Very clear information for setting up your sandbox.

  • @NotMuchHere
    @NotMuchHere 3 года назад

    Thank you for providing this. I wanted to do host only networking but was clueless. This has been a great help.

  • @amitbajpai6265
    @amitbajpai6265 4 года назад

    How did you come out without saving the name of file in nano while changing the hostname

  • @clintonp8621
    @clintonp8621 5 лет назад

    Thank you Very much Corey! That was absolutely helpful..Was about to switch back to Vmware-workstation as I was familiar with that..

  • @shun747
    @shun747 4 года назад

    So can this affect other devices that are not a VM across the internet as well?

  • @kilianbrandt1069
    @kilianbrandt1069 4 года назад

    That was a great tutorial, thank you! I've got an extra question and hope someone can give me an hint. For example in the video ubuntu-1 git the IP: 192.168.56.100. There are 2 network adapters defined. As far as I understand NAT for internet and the second for the communication inside the vm network. Now the question: What would be the approach to connect and lets say ping ubuntu-1 from another physical machine (e.g. an Raspberry Pi), which is connected to the host pc? Do we need a third adapter allowing the connection between them?

    • @srihariitsme
      @srihariitsme 4 года назад +1

      To connect to your host pc - the one which is running virtual box, you need to change your network adapter1 setting from NAT to Bridged adapter.

  • @Ambient_Life
    @Ambient_Life 3 года назад

    watched this entire video and gained so so much from it and it took literally 2 hours since I had to do research on troubleshooting but definitely something worth the time. great video Corey ❤thanks

  • @anisdhouieb9918
    @anisdhouieb9918 6 лет назад

    Awesome tutorials ,we're looking for tutorials about ansible and jenkins

  • @spoonmanchen7631
    @spoonmanchen7631 6 лет назад

    I really enjoy the style of Corey Schafer, He always makes a complex question simple and clear.
    Thanks a lot. My hero.

  • @kristiannn
    @kristiannn 3 года назад

    8:33 - ifconfig -a
    9:30 - 11:44
    14:50 - ssh from host into vm

  • @nickng8069
    @nickng8069 4 года назад

    can we use a browser in virtual box vm?

  • @madanimehenni8561
    @madanimehenni8561 5 лет назад

    how shered file in two virtual machin ?

  • @sergior.m.5694
    @sergior.m.5694 4 года назад

    man you are the best, thank you

  • @lifelong9717
    @lifelong9717 5 лет назад

    I dont see host only network on windows

  • @ddfgrtsd
    @ddfgrtsd 4 года назад

    Thanks! This is Awesome!

  • @feezoo82
    @feezoo82 2 года назад

    loved it man

  • @Thomas_Grusz
    @Thomas_Grusz 3 года назад

    Great, thanks!

  • @Rooot-username
    @Rooot-username 6 лет назад

    Can I do the same for telnet?

  • @lazyac_
    @lazyac_ 6 лет назад

    Thank you very much! :D

  • @hamiltonlima
    @hamiltonlima 6 лет назад

    thanks :)

  • @anisdhouieb9918
    @anisdhouieb9918 5 лет назад

    would you publish videos about ansible and Jenkins in the near future ? I like your videos

    • @coreyms
      @coreyms  5 лет назад +1

      I want to cover those topics, yes. I'm not sure if I will cover them in the immediate future though just because I have a couple of series' I need to finish first.

    • @anisdhouieb9918
      @anisdhouieb9918 5 лет назад

      @@coreyms thx for all the great work you're doing !!!

  • @pavanscott
    @pavanscott 7 лет назад +2

    Kindly add docker videos also 🙏
    it's very helpful👍👌✌

  • @billallwell6507
    @billallwell6507 6 лет назад

    Nice tutorial mate.

  • @jackeyzhu3702
    @jackeyzhu3702 4 года назад

    I thought static IP addresses are paid to get :(

    • @betoian
      @betoian 4 года назад

      :) Thees are LAN (everybody use the same)

  • @janpoonthong
    @janpoonthong 4 года назад

    I dont see /etc/network.intterfaces file

    • @fernfaba
      @fernfaba 2 года назад

      /etc/network/interfaces is deprecated (google this for more info)
      I installed the following and it worked:
      --------
      sudo apt install ifupdown

    • @janpoonthong
      @janpoonthong 2 года назад

      @@fernfaba I already quit, I asked two years ago, lol

  • @zhencao6115
    @zhencao6115 7 лет назад

    Nice vedio Corey. Btw, why I can,t ping a virtual machine at my host machine. I also use mac os.

    • @coreyms
      @coreyms  7 лет назад

      Hmm, there could be a lot of reasons it isn't working. Are you sure they're on the same Host-Only network and that you've set all of the static IPs correctly?

    • @zhencao6115
      @zhencao6115 7 лет назад

      I will try tonight!. Thank you for your answer. Really love your tutorial. I enjoy one of your video per night. Thank you for sharing your knowledge and your skillful teaching technique!

    • @mikesmith9538
      @mikesmith9538 7 лет назад

      I have the same issue. I'm running Windows 10 on the host and I followed the directions explicitly and rechecked them many times. I can ping the host from the virtual machine, but I can't ping the virtual machine from the host. I can ping 192.168.56.1 from the host, but I can't ping 192.168.56.100 (the virtual machine) from the Windows 10 host.
      Do you have any idea what could be causing the issue?
      Mike

    • @mikesmith9538
      @mikesmith9538 7 лет назад +1

      I solved my issue. It was caused by the Windows 10 Firewall. This is what I did:
      Start Windows Firewall (Control Panel)
      Choose Windows Firewall Properties
      Choose - Domain Profile Tab
      Click Customize (Protected network connections
      Uncheck - Virtual-Host Only Network
      Click OK
      Repeat the above for the Private Profile and the Public Profile tabs
      Verify the Host can ping the VM.
      Go back and re-check the Virtual-Host Only Network to re-enable the Windows 10 Firewall.
      Verify the Host can still ping the VM.
      I don't know if leaving the Windows Firewall active for the Virtual-Host Only Network connection will continue to work, but now I know how to disable it.

  • @little006little006
    @little006little006 6 лет назад

    Does this work if the two VMs are hosted on two different physical machines?

    • @abhisheksaharan
      @abhisheksaharan 6 лет назад

      i believe it will will if they are under same network and running.