Computer >> कंप्यूटर >  >> सॉफ्टवेयर >> आभासी मशीन

वर्चुअलबॉक्स में नेटवर्क और साझाकरण - पूर्ण ट्यूटोरियल

वर्चुअलबॉक्स प्रबंधन पर यह चौथा लेख है। आज, मैं आपको वर्चुअलबॉक्स नेटवर्किंग और शेयरिंग के बारे में जानने के लिए आवश्यक सब कुछ सिखाने जा रहा हूँ।

मैं आपको आपकी वर्चुअल मशीन को कॉन्फ़िगर करने के तीन अलग-अलग तरीके और होस्ट मशीन और वर्चुअल मशीन के बीच डेटा साझा करने के तीन अलग-अलग तरीके दिखाने जा रहा हूँ। इस ट्यूटोरियल में महारत हासिल करने के बाद, आपको मज़ा और आत्मविश्वास के साथ वर्चुअलबॉक्स का उपयोग करने के बारे में जानने के लिए सब कुछ पता चल जाएगा। मेरे पीछे आओ।

परिचय

अधिक जानकारी के लिए, आपको निम्नलिखित लेख पढ़ना चाहिए। वे आपको आज की सामग्री को आसानी और आनंद के साथ पालन करने के लिए आवश्यक पृष्ठभूमि प्रदान करेंगे:

वर्चुअलबॉक्स अतिथि परिवर्धन कैसे स्थापित करें - ट्यूटोरियल

वर्चुअलबॉक्स 3 अद्भुत है!

वर्चुअलबॉक्स 3 कॉम्पिज़ स्लाइड शो

DirectX in VirtualBox 3 - शुद्ध आनंद यहाँ है

इसी तरह, आपको इस श्रंखला की पहली तीन किश्तें पढ़नी चाहिए:

वर्चुअलबॉक्स में डिस्क क्लोन कैसे करें - ट्यूटोरियल

वर्चुअलबॉक्स में हार्ड डिस्क कैसे जोड़ें - ट्यूटोरियल

वर्चुअलबॉक्स में डिस्क का विस्तार / सिकुड़न कैसे करें - ट्यूटोरियल

अब, चलिए शुरू करते हैं।

वर्चुअलबॉक्स नेटवर्क विकल्प

अपनी किसी भी स्थापित वर्चुअल मशीन के लिए, सेटिंग> नेटवर्क पर क्लिक करें। यहाँ मज़ा शुरू होता है। यह डिफ़ॉल्ट दृश्य है। किसी भी वर्चुअल मशीन में अधिकतम चार नेटवर्क एडेप्टर हो सकते हैं। जैसा कि आप फिट देखते हैं आप उन्हें चुनिंदा रूप से सक्षम कर सकते हैं। ज्यादातर लोगों को सिर्फ एक की आवश्यकता होगी।

एडॉप्टर प्रकार वर्चुअलाइज्ड हार्डवेयर को परिभाषित करता है जो वर्चुअलबॉक्स आपके वर्चुअल मशीन को उजागर करेगा। यदि आपको एडॉप्टर प्रकारों में से किसी एक के साथ कोई समस्या है, तो आप दूसरा प्रयास कर सकते हैं। PCnet-FAST III डिफ़ॉल्ट चयन है।

आपके पास पुरानी मशीनों के लिए PCnet-FAST II और तीन प्रकार के Intel PRO/1000 कार्ड भी हैं, जिनमें दो सर्वर संस्करण शामिल हैं, जो उत्पादन वातावरण में VirtualBox चलाने वाले लोगों के लिए उपयोगी होना चाहिए। घरेलू उपयोगकर्ताओं के लिए, चुनाव बल्कि पारदर्शी है।

सबसे दिलचस्प हिस्सा संलग्न है:अनुभाग। यह श्रेणी परिभाषित करती है कि आपका नेटवर्क एडॉप्टर मौजूदा भौतिक हार्डवेयर के साथ कैसे इंटरफेस करेगा। अलग-अलग सेटअप के परिणामस्वरूप स्पष्ट रूप से भिन्न परिणाम होंगे।

नेटवर्क प्रकार

हमारे पास यहां चार विकल्प हैं:NAT (डिफ़ॉल्ट), ब्रिजेड, इंटरनल नेटवर्क और केवल होस्ट। बेशक, संलग्न नहीं भी एक प्रकार है, लेकिन ऐसा नहीं है जिसे हम वास्तव में उपयोग कर सकते हैं।

नेटवर्क एड्रेस ट्रांसलेशन (NAT)

NAT का अर्थ है कि वर्चुअल मशीनों में निजी IP पते होंगे जो बाहर से रूट करने योग्य नहीं हैं।

उदाहरण:आपका होस्ट 192.168.1.1 है। VirtualBox NAT डिवाइस को 10.0.2.1 के रूप में चिह्नित किया जाएगा। इसलिए, वर्चुअल मशीन को 10.0.2.x रेंज में कोई भी पता दिया जाएगा। चूंकि 10.0.2.x/24 सबनेट में मशीनों तक पहुंच को रूट करने के लिए कुछ भी नहीं है, वे आपके मेजबान से पहुंच योग्य नहीं होंगे।

यह सेटअप तब उपयोगी होता है जब आप वास्तव में परवाह नहीं करते हैं कि आपके मेहमानों के आईपी पते क्या हैं, हर एक का अपना। हालाँकि, यह अच्छा नहीं है यदि आपको अग्रेषण की आवश्यकता है या यदि आपको बाहरी दुनिया में सेवाओं को प्रदर्शित करने की आवश्यकता है। इसी तरह, यह सेटअप नेटवर्क एक्सेस के माध्यम से साझा करने के लिए अच्छा नहीं है।

प्लसस:सादगी और एकांत।

कमियां:आभासी मशीनों के लिए कोई मार्ग नहीं, कोई नेटवर्क साझाकरण नहीं।

ब्रिज एडॉप्टर

ब्रिज एडॉप्टर का अर्थ है कि चलने वाली कोई भी वर्चुअल मशीन उसी स्रोत से आईपी एड्रेस प्राप्त करने का प्रयास करेगी जो आपके वर्तमान में सक्रिय है, डिफ़ॉल्ट नेटवर्क एड्रेस को इसका आईपी एड्रेस मिला है। इसलिए शब्द ब्रिज किया गया, क्योंकि दोनों जुड़े हुए हैं।

यदि आपके पास एक से अधिक सक्रिय नेटवर्क डिवाइस हैं, तो आप चुन सकते हैं कि आप वर्चुअलबॉक्स के साथ किसे जोड़ना चाहते हैं। हमारे मामले में, हम वायरलेस एडेप्टर wlan0 का उपयोग करेंगे।

उदाहरण:आपके होस्ट ने राउटर से 192.168.1.100 का पता पट्टे पर लिया है। वर्चुअल मशीन राउटर से 192.168.1.103 का पता पट्टे पर देती है। दो मशीनें अब एक ही नेटवर्क साझा करती हैं और सभी मानक नियम लागू होते हैं। सभी व्यावहारिक उद्देश्यों के लिए, वर्चुअल मशीन आपके LAN पर एक अन्य IP पता है।

अधिक बारीकी से, मेजबान:

और मेहमान:

यदि आपका डिवाइस (स्विच, राउटर, आईएसपी, आदि) आपको एक से अधिक आईपी पते पट्टे पर देने की अनुमति नहीं देता है तो यह सेटअप काम नहीं कर सकता है। इसलिए, सीधे इंटरनेट एक्सेस वाले कंप्यूटर ब्रिज्ड नेटवर्किंग का उपयोग करने में सक्षम नहीं हो सकते हैं।

प्लसस:सक्षम पोर्ट अग्रेषण और सेवाओं के साथ नेटवर्क के लचीले प्रबंधन की अनुमति देता है। क्लासिक तरीके से नेटवर्क शेयरिंग की अनुमति देता है।

कमियां:सीधे इंटरनेट एक्सेस के साथ काम नहीं कर सकता (राउटर की आवश्यकता होती है), नए उपयोगकर्ताओं के लिए समझना अधिक कठिन होता है, संभावित सुरक्षा निहितार्थों के साथ मशीनों को नेटवर्क में उजागर करता है।

होस्ट-ओनली अडैप्टर

होस्ट-ओनली एडॉप्टर बहुत दिलचस्प है। यह ब्रिजेड एडेप्टर के समान है, सिवाय इसके कि यह एक समर्पित नेटवर्क डिवाइस का उपयोग करता है, जिसे vboxnet0 कहा जाता है, आईपी पते को पट्टे पर देने के लिए।

आपकी होस्ट मशीन 192.168.56.1 के आईपी पते के साथ वास्तविक रूप से वर्चुअलबॉक्स राउटर है। यदि केवल-होस्ट सेटअप के साथ कोई वर्चुअल मशीन नहीं चल रही है तो एडॉप्टर उपयोग में नहीं है। हालाँकि, एक बार जब वे ऊपर आ जाते हैं, तो यह एडॉप्टर आपके अपने नेटवर्क के भीतर, एक आंतरिक LAN बनाते हुए, वर्चुअल मशीनों को IP पते प्रदान करता है।

उदाहरण:आपके होस्ट का IP पता 192.168.56.1 है। आपकी वर्चुअल मशीन का IP पता 192.168.56.101 है।

अधिक बारीकी से, मेजबान:

और मेहमान:

यह काफी हद तक VMware सर्वर के समान है। VMware सर्वर के दो वर्चुअल एडेप्टर हैं जिन्हें vmnet1 और vmnet8 कहा जाता है, जिनका उपयोग मेहमानों को NAT और होस्ट-ओनली IP एड्रेस असाइन करने के लिए किया जाता है। However, unlike the VirtualBox NAT adapter, VMware Server always bridges the default network device on your hosts and therefore you have direct network access to NAT-ed machines. You don't have this luxury on VirtualBox (yet).

But the addition of vboxnet0 in VirtualBox 3 has significantly simplified network usage in this phenomenal product. If you wish to recall the trouble I've had to deal with in earlier release of VirtualBox, do take a look at my VMGL tutorial. I had to manually configure everything. BTW, you can change the default IP address allocation, if you want. Very importantly, please note that using the Host-only adapter does not mean your guests will have Internet access. In fact, they won't. vboxnet0 does not have a default gateway. To make vboxnet0 also serve queries outside the local network, you will have to configure it to use another adapter for that, enable forwarding and possible reconfigure your firewall rules. At the end, you will have achieved Bridged networking, so why bother?

Host-only Adapter is useful for creating private networks, where machines need access to one another, but not necessarily outside this subnet.

Pluses:Useful for noisy software testing, penetration testing. Allows classic network sharing via IP address.

Minuses:As difficult to understand as Bridged networking for new users, no Internet access in the virtual machines. May introduce a security risk to other machines on the private network.

Internal network

Internal network is not very interesting, in my opinion. It's similar to Host-only + NAT, except the networking takes place inside the virtual network of guest machines, without any access for the host, plus there is no real NAT. What you get is a private LAN for your guests only, without any access to the external world.

Sharing in VirtualBox

Now that we understand networking options, let's try some sharing. There are two ways you can share your data in VirtualBox, either by direct network access, using IP addresses, or by using the Shared Folders feature.

Personally, I prefer the network solution, because this is how things work in the real world. You send requests to other machines via the network. If they have sharing services, like NFS or Samba listening and if you're properly authenticated, you'll be given the list of shares and allowed to exchange files with this server. Another way of sharing is by FTP or SSH, again, using the classic network channels.

Shared Folders is a feature where you create a folder on your host and then mount it inside your virtual machines. It works for all network setups and uses an internal VirtualBox sharing server to allow guest access to the shared data.

Sharing via network

Earlier, we mentioned that sharing via network is only possible for Bridged and Host-only network. Let's see two examples. The first step is to allow sharing in the guest machine.

Then, you access the virtual machine via its IP address.

On Windows:

On Windows, use Start> Run> \\XXX.XXX.XXX.XXX and replace the triplets of Xs with the actual IP of the virtual machine.

On Linux:

Type smb://XXX.XXX.XXX.XXX in the address bar of the file manager. smb:// stands for the Samba network protocol. The triplets of Xs stand for the IP address of our guest machine.

With Bridged networking, it looks like this:

With Host-only, it looks like this:

Ignore the title Windows shares. Samba is usually used to share with Windows hosts. NFS is more typically used for Linux machines. Samba is preferred, because it works with both. For more about Samba sharing, please take a look at this tutorial.

Shared Folders

पी.एस. All of the above is identical for Windows and Linux guests, by the way. To this end, I decided to take the last set of screenshots demonstrating Shared Folders on a Windows machine.

Now, Shared Folders are quite simple to setup. Your first step is to configure a folder on your host that you wish to share. For any virtual machine, open the Settings menu and go to Shared Folders.

In the right pane, you will have a list of all shared folders on the machine. You can add and remove them as you see fit. The little icons to the right are used for that purpose.

Folder Path:

This is the actual, physical path that you wish to share. On Windows, the folder path will be something like C:\shared. On Linux, it will look something like /home/roger/shared.

Folder Name:

This is the name of the share that your guests will see. Please use names without spaces, something like Shared-folder or Banana. This name can be identical to the actual folder you're sharing, but it does not have to be. But please note, this is not a path! It's a symbolic name for virtual machines to use, as they do not see your physical hardware.

Once you've created the path, boot you virtual machine.

On Windows:

If your virtual machine is a Windows host, you can access the network share either via the command line or using the Tools> Map Network Drive option in the Explorer menu.

On the command line, you need to use the net use command.

net use \\vboxsvr\share-name

net use is the command for mounting network drives.

is the drive that will be assigned the share inside your virtual machine. It can be any free letter, like E:, G:, X:, etc.

\\vboxsvr\share-name is the path to the share. \\vboxsvr is the VirtualBox sharing server. share-name is the actual folder name from earlier. So if you called your share Rambo, then the path reads \\vboxsvr\Rambo.

The command then looks like:

net use h:\\vboxsvr\Rambo

Via the Tools menu in the Explorer, it looks like this:

You can check Reconnect at logon, so you don't have to repeat this task every time you power on the virtual machine. Once you click Finish, you will have a new drive under your My Computer. Opening this new drive letter will take you into the Shared folder.

On Linux:

This is done by a simple command in a terminal windows:

mount -t vboxsf share mount_point

vboxsf is the pseudo-filesystem type used to mount the Shared Folder. It's an abstract translation layer for the virtual sharing service used by VirtualBox.

share is the name of the folder from earlier. Remember, the name and not the path! For example, if our share is called Banana then share =Banana.

mount_point is any directory in your Linux tree where you wish to mount the Shared folder to. For example, /home/roger/shares-go-here.

Thus, our command looks like:

mount -t vboxsf Banana /home/roger/shares-go-here

And then, everything that is inside the shared folder on your host will be visible inside the virtual machine by going to the above path.

To automate the task, you can add the mount option to the /etc/fstab menu. Again, for more details on how to do this, please refer to my Linux commands tutorial.

BTW, notice the help in the Settings menu, explaining how to achieve this!

और यह सबकुछ है।

निष्कर्ष

Now, you know everything you need to know about VirtualBox network &sharing. Windows, Linux, bridged, host-only, NAT, sharing via network, sharing via Shared Folders, you name it, you have it all. I hope you have enjoyed this tutorial.

और अच्छी चीज़ों के लिए बने रहें।

प्रोत्साहित करना।

  1. वर्चुअलबॉक्स में डिस्क क्लोन कैसे करें - ट्यूटोरियल

    यदि आप व्यवसाय या आनंद के लिए वर्चुअलाइजेशन का उपयोग कर रहे हैं, तो हो सकता है कि आपको वर्चुअलबॉक्स मिल गया हो, एक बहुत ही शक्तिशाली, अत्यधिक बहुमुखी मुफ्त समाधान जो डेस्कटॉप उपयोगकर्ताओं को ऑपरेटिंग सिस्टम को तैनात करने की बात आने पर अत्यधिक लचीलेपन की अनुमति देता है, किसी भी तरह से। और यदि आप शौ

  1. वर्चुअलबॉक्स 3.0.0 अद्भुत है!

    मेरे पसंदीदा डेस्कटॉप वर्चुअलाइजेशन सॉफ्टवेयर में वर्चुअलबॉक्स और वीएमवेयर सर्वर शामिल हैं। मैं उन दोनों को प्यार करता हूं और उनका इस्तेमाल करता हूं। वे समग्र रूप से काफी समान हैं, हालांकि अभी भी उपयोगकर्ता को सुविधाओं का एक अलग, अद्वितीय उपसमुच्चय प्रदान करते हैं जो अन्य उत्पाद में नहीं है, इस प्रक

  1. आभासी मशीनों में 3D त्वरण - भाग 2:VirtualBox और OpenGL - ट्यूटोरियल

    वर्चुअल मशीनों में 3डी वर्चुअलाइजेशन को कॉन्फ़िगर करने और उपयोग करने के लिए समर्पित तीन लेखों में से यह दूसरा है। आज, हम सीखेंगे कि विंडोज या लिनक्स होस्ट पर स्थापित वर्चुअलबॉक्स में चल रहे विंडोज वर्चुअल मशीनों के लिए ओपनजीएल एप्लिकेशन (और गेम) के लिए 3डी त्वरण को कैसे सक्षम किया जाए। पहले लेख मे