Cannot ping to VMware guest

64

By default Windows Server 2008 is set to not respond to ping replies. To enable it;

Go to Window Firewall with Advance Settings from Administrator Tools menu.

Look inside Inbound Rules, scroll down to File and Printer Sharing, right click and enable the one with Echo Request - ICMPv4-in rule.

Make sure the icon is green.

Ping your server.

Share:
64

Related videos on Youtube

SwezedCode
Author by

SwezedCode

Updated on September 18, 2022

Comments

  • SwezedCode
    SwezedCode almost 2 years

    I been coding on a autoclicker, I just finished but I can't click anything, I can be in the window open but I can't click any button or slider etc.

    I am using jnativehook as api for checking mouse press outside.

    import java.awt.EventQueue;
    import java.awt.Font;
    import java.awt.Robot;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.util.Random;
    
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.EmptyBorder;
    
    import org.jnativehook.GlobalScreen;
    import org.jnativehook.NativeHookException;
    import javax.swing.JSlider;
    import javax.swing.JTextField;
    
    import java.awt.AWTException;
    import java.awt.Color;
    
    public class AutoClicker extends JFrame implements Runnable {
    
        public static AutoClicker get = new AutoClicker();
    
        private static final long serialVersionUID = 1L;
        private JPanel contentPane;
    
        public static boolean enabled = false;
    
    //  private MouseHandler mouse;
        private JTextField textField;
        private JTextField textField_1;
    
        public boolean activated;
        public boolean skipNext;
    
        /**
         * Launch the application.
         */
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    try {
                        AutoClicker frame = new AutoClicker();
                        frame.setVisible(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    
        /**
         * Create the frame.
         */
        public AutoClicker() {
            setTitle("Swezeds AutoClicker");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setBounds(100, 100, 403, 253);
            contentPane = new JPanel();
            contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
            setContentPane(contentPane);
    
            JButton btnStart = new JButton("Start");
            btnStart.setBounds(88, 36, 89, 23);
            btnStart.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    enabled = true;
                }
            });
            contentPane.setLayout(null);
            contentPane.add(btnStart);
    
            JButton btnStop = new JButton("Stop");
            btnStop.setBounds(187, 36, 89, 23);
            btnStop.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    enabled = false;
                }
            });
            contentPane.add(btnStop);
    
            JLabel lblSwezedsAutoclicker = new JLabel("Swezeds AutoClicker");
            lblSwezedsAutoclicker.setBounds(102, 11, 167, 14);
            lblSwezedsAutoclicker.setFont(new Font("Impact", Font.PLAIN, 20));
            contentPane.add(lblSwezedsAutoclicker);
    
            JCheckBox chckbxClickingSound = new JCheckBox("Clicking Sound");
            chckbxClickingSound.setBounds(6, 184, 118, 23);
            contentPane.add(chckbxClickingSound);
    
            JSlider slider = new JSlider();
            slider.setValue(5);
            slider.setMaximum(20);
            slider.setBounds(88, 70, 188, 14);
            contentPane.add(slider);
    
            JSlider slider_1 = new JSlider();
            slider_1.setMaximum(20);
            slider_1.setValue(12);
            slider_1.setBounds(88, 112, 188, 14);
            contentPane.add(slider_1);
    
            JLabel lblNewLabel = new JLabel("Max CPS");
            lblNewLabel.setBounds(32, 112, 76, 14);
            contentPane.add(lblNewLabel);
    
            JLabel lblMinCps = new JLabel("Min CPS");
            lblMinCps.setBounds(32, 70, 76, 14);
            contentPane.add(lblMinCps);
    
            textField = new JTextField(slider.getValue() + "");
            textField.setEditable(false);
            textField.setBackground(Color.LIGHT_GRAY);
            textField.setBounds(276, 64, 31, 20);
            contentPane.add(textField);
            textField.setColumns(10);
    
            textField_1 = new JTextField(slider_1.getValue() + "");
            textField_1.setEditable(false);
            textField_1.setBackground(Color.LIGHT_GRAY);
            textField_1.setColumns(10);
            textField_1.setBounds(276, 109, 31, 20);
            contentPane.add(textField_1);
        }
    
        public static int randInt(int min, int max) {
            Random rand = new Random();
            int randomNum = rand.nextInt((max - min) + 1) + min;
            return randomNum;
        }
    
        public boolean isSkipNext() {
            return skipNext;
        }
    
        public void setSkipNext(boolean skipNext) {
            this.skipNext = skipNext;
        }
    
        public boolean isEnabled() {
            return enabled;
        }
    
        public void setEnabled(boolean enabled) {
            AutoClicker.enabled = enabled;
        }
    
        public boolean isActivated() {
            return activated;
        }
    
        public void setActivated(boolean activated) {
            this.activated = activated;
        }
    
        @Override
        public void run() {
            try {
                for (;;) {
                    Thread.sleep(1L);
                    if ((isActivated()) && (isEnabled())) {
                        try {
                            Thread.sleep(1L);
                            Robot robot = new Robot();
                            while (true) {
                                try {
                                    setSkipNext(true);
                                    Thread.sleep(AutoClicker.randInt(100, 150));
                                    robot.mousePress(InputEvent.BUTTON1_MASK);
                                    robot.mouseRelease(InputEvent.BUTTON1_MASK);
                                } catch (InterruptedException ecksdee) {
                                }
                            }
                        } catch (AWTException ecksdee) {
                        }
                    }
                }
            } catch (Exception localException) {
            }
            try {
                GlobalScreen.registerNativeHook();
                this.mouse = new MouseHandler();
                GlobalScreen.addNativeMouseListener(this.mouse);
            } catch (NativeHookException exception) {
                exception.printStackTrace();
            }
    
        }
    }
    
    • XtremeBaumer
      XtremeBaumer over 7 years
      post code in question as well as error log
    • Jens
      Jens over 7 years
      Do not post code as link to an Image. post a minimal reproducible example as text
    • Malakai
      Malakai over 7 years
      Please provide code sample(without external links) and stacktrace that you've got.
    • MadProgrammer
      MadProgrammer over 7 years
      You've overridden get/setEnabled which are methods of the JFrame which affect the state of the user interaction, so basically, you've disabled the frame. Suggestion, use a model to manage the state, don't extend directly from JFrame (you actually have two different instances running around), use a JPanel as the base component and add it what ever window you need when you need to
  • chrisma andhika
    chrisma andhika about 12 years
    Hai beano, I try it and still, my laptop cannot ping my vm
  • chrisma andhika
    chrisma andhika about 12 years
    There is another odd thing. The IP segment of my office building is 10.10.20.xxx. My laptop gets the right IP, but my VM gets IP 192.168.23.xxx.
  • sgtbeano
    sgtbeano about 12 years
    Ah, you have a NAT'd address on your VM, try changing the network type on the VM to bridged.
  • sgtbeano
    sgtbeano about 12 years
    Hey, no problem - glad it works