Lỗi this operation is not permitted in secure mode dosbox năm 2024
DOSBox-X has support for emulating the Novell NE2000 network adapter through the use of either PCAP or SLIRP back-end. This guide describes how to set it up and also tries to simplify the process for users. Show
Apart from NE2000 networking, DOSBox-X also has integrated IPX support and network redirector functions. In Windows builds of DOSBox-X, you can directly access or browse network resources using UNC network paths in the form \\MACHINE\FOLDER using DOS commands (such as DIR, MD and COPY) when the network redirector feature is not disabled. NE2000 resource usageBy default, the emulated NE2000 will use IRQ 3 and IO range 300-31F. This is typical of a real NE2000 adapter, and some NE2000 drivers will look there by default. Note DOSBox-X does not support PnP for the NE2000, meaning that Windows 95, 98 and ME may not autodetect it, and even if they do, they may assume the wrong resources. The problem lies in the fact that, IRQ 3 is also used for COM2, and therefore they conflict. Most software will work regardless of the conflict, as long as you’re not actually using COM2. But some software, notably Windows 95, 98 and ME may complain about a resource conflict. As such it is recommended to either move the emulated NE2000 adapter to a different IRQ, or to disable COM2. In the below examples the emulated NE2000 is set to IRQ10 using the LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
7 setting, to resolve the conflict. But you need to ensure that any NE2000 device drivers that are loaded, are also set to look for it at the same resources.Note Setting the NE2000 to IRQ 10 is not possible if you’re emulating a 8086 ( LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
8), as they only have IRQ 0-7 available. In that case it is probably better to disable COM2. If you want to instead disable COM2, and leave the emulated NE2000 at its default resources, add the following to you DOSBox-X config file. [serial] serial2=disabled To enable networking you first need to enable NE2000 adapter emulation in your DOSBox-X config file and select an appropriate back-end for the NE2000 emulation. [ne2000] config optionsne2000
This setting enables or disables the NE2000 emulation. nicbase
This is the IO base address of the emulated NE2000 adapter. You may sometimes see the base address written as 0x300 which means hex 300. It will require 32bits, starting at the defined base address. So for the default base value of 300 the full IO range used is actually 300-31F. nicirq
This is the IRQ (Interrupt Request Level) of the emulated NE2000 adapter. You cannot just select a random value as many IRQs are already pre-assigned to various devices. e.g.
Warning The default IRQ value (3) conflicts with the emulated COM2 port that is enabled by default. Warning If you’re emulating a 8086 CPU machine type, the valid IRQ needs to be in the range of 0-7, which in this case effectively means 3, 4 or 5. This is because the 8086 only had a single PIC (Programmable Interrupt Controller), while later machines had two. macaddr
This is the MAC address of the emulated NE2000 adapter. Only one instance of a MAC address may exist on a network. Warning If you want to run multiple DOSBox-X instances on the same network, you MUST ensure they all have a different MAC address. The first 3 bytes are known as the OUI (Organisational Unique Identifier), and typically represent the network card manufacturer. The AC:DE:48 OUI used by default, is a special private range, and it is recommended that you use this range. The last 3 bytes can be freely chosen. Each byte can range from 00 to FF. Some examples of valid alternative MAC addresses with the same OUI:
Selecting a back-end for NE2000There are two different back-ends to the NE2000 adapter emulation, namely pcap and slirp. The default is LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
9, which implies
0 if SLIRP support is available, otherwise
1 is implied if PCAP support is available. backend=pcapThe PCAP back-end uses something called "Promiscuous mode". This has the advantage that applications in DOSBox-X can use various legacy network protocols, such as IPX/SPX and NetBIOS Frames (aka NetBEUI) in addition to TCP/IP. This mode not only allows communication between different DOSBox-X instances on the same network, but also with legacy PCs on the same network. However, for this to work DOSBox-X needs to have very low level access to your real network adapter. In some cases this is not possible, such as:
To enable NE2000 emulation with the pcap back-end, add the following to your DOSBox-X config file:
The ''list'' value for ''realnic='' will need to be replaced by a value representing your actual network adapter. See below for more information. [ethernet, pcap]Create this section in your DOSBox-X config file if you want to use PCAP. The only value that you normally need to set here is
2. realnic
In the below examples you will see the usage or
2. Once you have located the host network adapter to use, using
4, you need to set it to that adapter. This can be done in one of two ways. You can either specify the number of the adapter, or a part of the name of the adapter. e.g. If you want to use the entry: LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
You can either specify it as
5 or
6, or if that is not unique you can also fully specify the name like so:
7 It is recommended to use a name, as the order of the numbers can change due to various events on the host (e.g. adding or removing devices, or even launching other virtual machines) timeout
Specifies the read timeout for the device in milliseconds for the pcap backend, or the default value will be used. The default for Windows hosts is -1 which to WinPCap appears to mean "non-blocking mode". For other platforms the default is 3000ms backend=slirpUnlike the PCAP back-end, the SLIRP back-end does not require Promiscuous mode. As such it will work with wireless adapters, and it will work in most sandboxed environments. But obviously, it has its own limitations.
To enable NE2000 emulation with the slirp back-end, add the following to your DOSBox-X config file:
You can optionally specify additional SLIRP options [ethernet, slirp]Create this optional section in your DOSBox-X config file. Generally these settings do not need to be modified from their default values. Just if you happen to be using the 10.0.2.0/24 network locally, will you need to modify the various IP settings. restricted
Disables access to the host from the guest. This effectively creates an isolated virtual network disable_host_loopback
Disables guest access to the hosts loopback interfaces. This effectively prevents the guest from accessing the hosts 127.0.0.0/8 loopback network. E.g. 127.0.0.1 mtu
The maximum transmission unit for Ethernet packets transmitted from the guest. Specifying 0 will use libslirp’s default MTU size of 1500 bytes. A value larger than 9000 is not recommended. MTU and MRU sizes should normally be identical. Note If you want to use a larger MTU than default, your hosts network adapter and your network switch needs to support it, otherwise the packets will get truncated. mru
The maximum receive unit for Ethernet packets transmitted to the guest. Specifying 0 will use libslirp’s default MRU size of 1500 bytes. MRU and MTU sizes should normally be identical. Note If you want to use a larger MRU than default, your hosts network adapter and your network switch needs to support it, otherwise the packets will get truncated. ipv4_network
The IPv4 network the guest and host services are on. ipv4_netmask
The netmask for the IPv4 network. ipv4_host
The address of the host system on the IPv4 network, which will act as the gateway. ipv4_nameserver
The address of the nameserver service provided by the host on the IPv4 network. ipv4_dhcp_start
The start address used for DHCP by the host services on the IPv4 network. tcp_port_forwards
Forwards one or more TCP ports from the host into the DOS guest. The format is:
Notes:
udp_port_forwards
The format is the same as for TCP port forwards. Setup guide for Linux hostsInstall libpcap and/or libslirpThis depends on your Linux distribution, but you need to have the libpcap library installed for the pcap back-end. Or the libslirp library for the slirp back-end. Debian based (e.g. Ubuntu)If you’re running a recent Debian or Debian based distribution such as Ubuntu, you can install the libraries from the command-line as follows:
Red Hat, SUSE or FedoraIf you used the provided RPM, libpcap and libslirp are dependencies and will be automatically installed when using a package manager to install DOSBox-X. Otherwise, if you’re running a recent Red Hat, CentOS, SUSE or Fedora Linux distribution, you can install the libraries from the command-line as follows:
Check if your DOSBox-X binary supports networkingThe provided RPMs have networking enabled, but if you compiled DOSBox-X yourself and the libpcap or libslirp headers where not installed, the resulting DOSBox-X binary will lack libpcap and/or libslirp support. To check if your binary has networking support, run the following command:
In the above example, the DOSBox-X binary has both libpcap and libslirp support, meaning it has networking. If the command returns nothing you do not have networking. If you’re DOSBox-x binary has no networking, your options are to use the pre-compiled RPM package, or compile it yourself with libpcap and/or libslirp support enabled. Setup permissions for PCAPThe provided RPM packages automatically set up the necessary permission for libpcap to function. Otherwise, you need to ensure that the DOSBox-X binary has permission to listen to and generate low level network traffic (promiscuous mode). You can do this as follows:
The first command returns the location of the dosbox-x binary (assuming it is in your path), the second command checks its capabilities. In this case getcap does not return anything, meaning it has no special capabilities, which you need to rectify if you want to be able to have PCAP networking in DOSBox-X. Run the following command:
This command will allow the dosbox-x binary to access the network interface in raw mode (pcap), meaning it can see all the traffic on all the network interfaces. To validate that now the DOSBox-X binary indeed has the cap_net_raw capability, run:
Warning: If you manually install the dosbox-x binary, you will have to take this step each time you do an upgrade. Locate host network interface for PCAPYou now need to find which host network interface you want to use for bridging with PCAP. For this you need to have a DOSBox-X config file with NE2000 support enabled, and you need to know which host network adapter will be used for bridging. It is highly recommended to only bridge to wired Ethernet adapters, as wireless adapters generally do not work with PCAP. Create a simple
5 config file as follows:
Now, from a terminal, start DOSBox-X, using the ne2000.conf config file you just created.
1 Now from the DOSBox-X menu bar, select Help followed by List network interfaces You will now get a list of available network interfaces, similar to the screenshot shown below. That is an example of the network interfaces that were detected for my Linux PC. Now look at your own list, and locate an appropriate adapter to use. In the above example, 1, or eno1 is the integrated Ethernet of my PC, which we will use in the below example. Edit the ne2000.conf config file and change realnic= to the number or name of your chosen network interface. e.g.:
2 You can merge your config snippet with your Windows for Workgroups, Windows 95 or 98 config file, or use it to run something like mTCP in DOSBox-X. Setup guide for Windows hostsInstall PCAPFirst you need to install PCAP support. As WinPcap is no longer maintained, Npcap seems the best candidate these days. Note At this point SLIRP is only supported in some MinGW builds, and not in Visual Studio builds. Locate host network interfaceYou now need to find which host network interface you want to use for bridging. For this you need to have a DOSBox-X config file with NE2000 support enabled, and you need to know which host network adapter will be used for bridging. It is highly recommended to only bridge to wired Ethernet adapters, as wireless adapters generally do not work. Create a simple
5 config file as follows:
3 Now, from a command prompt, start DOSBox-X, using the
5 config file you just created.
1 Now from the DOSBox-X menu bar, select Help followed by List network interfaces You will now get a list of available network interfaces, similar to the list shown below.
5 That is an example of the network interfaces that were detected for my Windows 10 PC (with the UUIDs masked). Now look at your own list, and locate an appropriate adapter to use. In the above example, 9 is the USB Ethernet adapter I want to use. It may take you a few tries to find the correct adapter. Edit the
5 config file and change
2 to the value or name of your chosen network interface. e.g.:
6 You can merge your config snippet with your Windows for Workgroups, Windows 95 or 98 config file, or use it to run something like mTCP in DOSBox-X. mTCP exampleThis example uses mTCP to test if networking is working in DOSBox-X. This requires that you first download the latest version of mTCP, and a NE2000 DOS packet driver (the latter is automatically available in DOSBox-X when the NE2000 networking feature is enabled). External links
unzip both mTCP and the NE2000 DOS Packet driver into a directory. In the below example the directory is named
0, then start DOSBox-X with the
5 config file that you created:
1 Now in DOSBox-X run the following commands:
8 If all worked fine, you should have gotten an IP address, and you can now do something like Common problem: Invalid MAC AddressWhen loading the NE2000 DOS Packet driver you get an all FF Ethernet MAC address:
9 This can actually have several causes.
Common problem: Cannot get DHCP leaseWhen starting DHCP you get only timeouts. LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
0This can actually have several causes.
Common problem: Multiple DOSBox-X instancesBy default, all DOSBox-X instances use the exact same MAC address (
8). If there are multiple DOSBox-X instances running on the same host, or on different hosts on the same network segment, they will conflict with each other. Unfortunately not all operating systems will warn you about this, but it will cause problems on the network and the DOSBox-X instances will not be able to communicate with each other. The solution is to define a new MAC address for at least one of the DOSBox-X instances. In your DOSBox-X config file, in the
9 section, add a
0 line with a new MAC address. The AC:DE:48 range is a reserved range for private use, so just modify the last three number blocks. e.g., LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
1IPX exampleThere are two ways to enable IPX communication, which was used by some DOS and Windows games for multi-player support. Using DOSBox-X integrated IPX supportDOSBox-X has integrated support for IPX over IP (IPX encapsulated in IP). You do not even have to enable NE2000 emulation for this. The advantage of this is that you can communicate with any other system that is directly reachable over TCP/IP. To test this, first
1 the remote systems from the host OS to ensure connectivity. A disadvantage of this approach is that you cannot communicate with retro PCs on the same network that are running the native IPX stack. This process is described on the DOSBox wiki. Using the NetWare 16-bit DOS ClientThis example uses Novell’s IPX stack, and only works with the PCAP back-end. A disadvantage of this approach is that it is not routable over the Internet, meaning it can only communicate with other systems running the native IPX stack on your local network. An advantage is that it can communicate with a real retro DOS PC running IPX on your local network. This requires that you first download the
2 and
3 files from the Novell NetWare 16-bit DOS Client. The rest of the NetWare client files are typically not needed for the purpose of running DOS games that require IPX. External links
Once you have downloaded the files, you need to extract them. The VLM121*.EXE files are individual self-extracting DOS ARJ archives. The easiest way is probably to extract them in DOSBox-X itself. Notes
Unpacking the VLM archive in DOSBox-XMove the files to a temporary directory for extraction, and from that directory launch DOSBox-X. Then run the following commands: LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
2The files needed are still packed in yet another "Personal NetWare Packed File" archive. Extract them as follows: LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
3The IPX directory that was created now contains the following files:
Create NET.CFGNow create a text file called
1, and place it in the same directory as
7, with the following content: LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
4Notes
Start IPXNow modify your
5 config file that you created earlier, such that it contains the following lines in the
7 section at the end: LOG: 9. rpcap://\Device\NPF_{AAAAAAAA-BBBB-CCCC-DDDD-XXXXXXXXXXXX}
5Adjust paths in the above example as necessary, and you should be able to run it from a command prompt as follows:
1 Note: For games that require NETBIOS, you can also add
8 at the end. But note that this is NetBIOS over IPX, which cannot communicate with other systems running native NetBIOS Frames (NBF) or NetBIOS over TCP/IP. |